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'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

1 Answer 1

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; mywiki.wooledge.org/DotFiles 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

 
discard

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.