Running Scripts and Commands at Start-up Time on (Ubuntu) - Quick Examples and Reference

Running Scripts and Commands at Start-up Time on (Ubuntu) - Quick Examples and Reference

Last updated:

commands to be run after startup ends

Add the code you want to run to /etc/rc.local.

  • before the call to exit 0
  • commands within are run as root

adding aliases to your command-line interface

You need to add alias code to ~/.bashrc

Example:

alias rr='sudo /etc/init.d/apache2 restart'

Close your terminal and then open up a new one for changes to take effect and run rr.