Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just want to run a very simple command on startup. How can I do that? I've searched google and it has very complicated examples, but what I need is just run this script on startup. How can I do that?


./init.d/opscenter-agent start

share|improve this question

2 Answers 2

If you want to do this as system startup (as opposed to when you log in to your computer), put the commands you want to run in /etc/rc.local.

See [Ubuntu] Executing a script at startup and shutdown.

share|improve this answer

If the script does not need to be run by root, you can do this:

1) Open "Startup Applications Preferences" (Alt + F2 and paste gnome-session-properties and hit Enter),

2) Press "Add" and select your script:

enter image description here

enter image description here

If you are not using a graphical environment, you can put the commands just before the line exit 0 in this file: /etc/rc.local. (To edit it just paste at terminal sudo nano /etc/rc.local.

share|improve this answer
Not good since I'm using Putty in order to manage Debian server, no GUI :) –  Stan May 6 '12 at 15:02
You can put the commands (or a link to your script) in this file: /etc/rc.local –  desgua May 6 '12 at 15:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.