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

This question already has an answer here:

I used a command i saw here to make my touch pad in lenovo 330 to scroll with 2 fingers and it worked exactly as i wanted but after each reset to the computer I need to retype the commend. Can you please tell me how i can make this command stay after i close my computer?

share|improve this question

marked as duplicate by Eliah Kagan, Luis Alvarado Mar 2 '14 at 21:25

This question was marked as an exact duplicate of an existing question.

Are you talking about this answer? You tried to comment on it using an answer, which I flagged for removal. – gertvdijk Jan 26 '13 at 22:53
Possible duplicate of How to start applications at startup automatically? – Eric Carvalho Jan 26 '13 at 23:12
@EricCarvalho Almost. He'll need to make a script file to run several commands. – gertvdijk Jan 26 '13 at 23:18
@gertvdijk That's OK, but I still think this question should be rephrased or maybe the answer you pointed should be improved to include persistence between reboots. – Eric Carvalho Jan 26 '13 at 23:29

Depends on the command. If X doesn't need to be running to do it, and it can be run as root, just add it to /etc/rc.local.

share|improve this answer
Well, usually they're depending on X, so running in rc.local isn't really recommended/reliable. I should recommend starting this in the DE session as a startup script. – gertvdijk Jan 26 '13 at 22:54

Commands can't "stay" after rebooting the computer. When you shut it down and the power gets cut off, or when you reboot and the memory is cleared, things are gone from the memory.

You can, though, either keep the system state, by hibernating and resuming, or, what I expect to be the best solution for you, run the command after each boot.

As your command is probably something for X Windows, it must be executed after starting X Windows. Here I do that by adding the command to ~/.xinitrc, but that's for startx, I think Ubuntu by default uses a graphical login screen, so you would need to use some other ~/.xsomething file. Perhaps ~/.xprofile?

share|improve this answer

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