Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I schedule a command to run the next time I log in? I don't want it to run every time, just once.

share|improve this question
Add your command in /etc/rc.local ? – karthick87 Dec 28 '10 at 5:27
Similar to How to run scripts on start up of ubuntu? – Marco Ceppi Dec 28 '10 at 13:13
up vote 3 down vote accepted

This is really "ugly" solution, but you can add classic logon/startup script and after first run remove this script automatically.


your command &
rm /path/to/script/

The script will be removed, so it can't be started again.

(I'm sure there's a bettter solution, but I don't know it.)

share|improve this answer
This gets the job done. For insurance, I went with mv "$0" /home/user/.old-scripts/ instead of rm. – ændrük Jan 19 '11 at 19:18

running a script has couple of options How to run scripts on start up of ubuntu?

I would try .gnomerc one, you can make it one time by making your script remove itself from .gnomerc once its done.

share|improve this answer

This is already covered on this very site : How to run scripts on start up of ubuntu?

The second answer down seems to be the cleanest solution.

share|improve this answer
This question is about running it during the next log in only, not during every start of the system. – Olathe Jun 4 '13 at 14:26
True enough. I saw the 'autostart' tag and took it from there. – Scaine Jun 5 '13 at 15:01

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.