I don't know how to phrase this to be clear. I'm not talking about terminals or shells, I know what the difference between login and non-login shells are. What I want to know is when I start up my computer and log in to the desktop, do any of the "dot files" (.profile
, .bash_profile
, .bashrc
, etc.) in my home folder get run? If so, which ones?
I'm asking because by default most terminal apps you open don't use login shells by default, but I've read advice saying not to modify things like environment variables in your .bashrc
file, to instead put it in .bash_profile
, but how am I to set those things if I'm primarily using non-login shells? Or is that advice maybe aimed at people who SSH into their workstations?
I obviously know how to work around any of those issues, I'm more explaining why I am curious about it than describing a problem I've run into.
/etc/profile
to begin with. That file will show a lot of what is happening and is a starting point to see all other files./etc/profile
and~/.profile
are sourced, and variables which are set there and exported will be available throughout the session. That's not the case with~/.bashrc
and~/.bash_profile
.