The Bash Shell Startup Files
http://www.linuxfromscratch.org/blfs/view/6.3/postlfs/profile.html The shell program /bin/bash (hereafter referred to as just "the shell") uses a collection of startup files to help create an environment. Each file has a specific use and may affect login and interactive environments differently. The files in the /etc directory generally provide global settings. If an equivalent file exists in your home directory it may override the global settings. An interactive login shell is started after a successful login, using /bin/login , by reading the /etc/passwd file. This shell invocation normally reads /etc/profile and its private equivalent ~/.bash_profile upon startup. An interactive non-login shell is normally started at the command-line using a shell program (e.g., [prompt]$ /bin/bash ) or by the /bin/su command. An interactive non-login shell is also started with a terminal program such as xte...