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 do you run a script when a user logs in? I have created a script and used chmod +x to make it executable where would I place the script to make it startup when a user logs in.

share|improve this question
up vote 4 down vote accepted

The script ~/.profile is executed at each login, you can put your script here.

But be aware that if you login in two different virtual terminals, the script will be executed twice.

share|improve this answer
~/.profile (which also calls ~/.bashrc) is only executed when logging into a shell (through Terminal or SSH for example). Not when logging into the GUI. – mivk Oct 18 '12 at 7:37

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.