To run a command right after you boot, before anybody logs in, add the command to the file /etc/rc.local:
- Open a Terminal.
- Become root:
su -
- Open the file in your favorite text editor:
vi /etc/rc.local
- Add the command that you want to run to the end of the file, on its own line.