When I start a bash terminal, my .profile is not being executed. I do not have a ~/.bash_profile or a ~/.bash_login, so .profile is supposed to run, right? What else could be wrong?

link|improve this question
feedback

2 Answers

up vote 1 down vote accepted

It's not a login shell.

If a shell is a login shell, it will look for .bash_profile if it exists, then .profile. Other shells look for .bashrc

So, you can put the things you want in every shell instance in .bashrc, and possibly have a reference that sources .bashrc in .profile.

So: .bashrc:

stuff you want

end of .profile:

[ -f ~/.bashrc ] && . ~/.bashrc
link|improve this answer
So when I run 'konsole' in KDE, that is a non-login shell, right? On another machine I have definitely put things in .profile and had them work when I open a terminal like this - I guess I don't understand when you'd want something different to happen at login vs when you open a terminal? – David Doria Feb 3 at 22:53
@DavidDoria it depends, I have changed configs or made aliases to what konsole runs, to make it run bash --login. In your case it seems to just run bash, which by default will not trigger a login shell – Rich Homolka Feb 3 at 22:56
If you are using LightDM that might be the reason. Other display managers like GDM and KDM source .profile on login, but LightDM does not (by design). See bugs.debian.org/cgi-bin/bugreport.cgi?bug=636108 – WakiMiko Feb 3 at 23:30
I am using KDM. – David Doria Feb 4 at 2:25
feedback

try using ~/.bashrc instead.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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