# How to run a simple command on startup



## asadfx (Feb 20, 2011)

Friends,

I want FreeBSD to run a simple command automatically as it starts up. I am not talking about some complicated script. Its:

[cmd=]# mixer pcm 100 vol 100 cd 100[/cmd]

I am using IBM Thinkpad T43p and FreeBSD 8.1.


----------



## UNIXgod (Feb 20, 2011)

rc()(8) will show which files control start and shutdown.


----------



## aragon (Feb 20, 2011)

It sounds like you want to save your mixer settings, in which case:

`# /etc/rc.d/mixer stop`

And your mixer should be restored on boot.

To answer your question, chuck your command into /etc/rc.local.


----------



## DutchDaemon (Feb 20, 2011)

You can also dump it in root's crontab(5) with @reboot as the time.


----------

