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

I've put a .bash_login file in my $HOME-directory but it doesn't execute. I've also tried .bash_profile but also doesn't work. There are also

  • .profile
  • .bash_history
  • .bash_logout

Any idea? I'm using Crunchbang 10 Statler.

share|improve this question
up vote 3 down vote accepted

Bash only looks for .bash_login or .profile files if it is executed as interactive login shell. When it is executed as interactive non-login shell it reads .bashrc. Commonly it is the second case i.e when you run gnome-terminal bash is run as non-login shell. Applications->Accessories->Terminal is a menu entry for gnome-terminal.

share|improve this answer
Just to add a bit to this; explains this more in detail, along with the history of why it is like this. In short, put environment variables (export MYVAR=value) in ~/.profile, and functions and aliases in ~/.bashrc. – geirha Jan 21 '11 at 8:28

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.