Originally Posted by jailbait
Some distributions use .profile and some use .bashrc.
Nope. (Reasons below).
Originally Posted by bach-fiend
What names the startup files have and in what order they are tried is something I have to look up every time I need it. Besides depending on the flavor of shell (Bash, Korn, Bourne, C etc) it can also depend on what you use the shell for. For example is this instance of the shell going to be your login shell? An interactive shell that is NOT the login shell? Just a shell script?
Yes. Hence, to the original poster I say: read the man page for the shell you are using.
The initialization files do not depend on the distro, but in the shell you use and how you use it (login vs. non login, interactive or not, special parameters passed, etc.), hence. For bash, you should be looking at ~/.bashrc for interactive but non-login shell. If you really mean an interactive login shell then it will first source /etc/profile if it exists, and after that it will source one and only one
of ~/.bash_profile, ~/.bash_login, and ~/.profile, only the first one will be used, even if it's empty, so, if ~/.bash_profile is there, ~/.profile will never be read by bash.
That and more is in the bash man page, so read it, specially the section titled "INVOCATION". Other shells will follow different rules, so if you don't use bash, read the man page for your shell.