System Config Files:
User Configuration Files:
You may wonder how the bash profile and rc script (bashrc) are all related.
Here is a synopsis on how these scripts are executed and what should be
put in each.
Each file is called only if it exists, if it does not, there will not be
an error, it will simply be skipped.
Once authenticated during logon and the shell you specified in the
/etc/passwd (chsh(1)) is called, if the shell is bash, the following
configuration files are processed.
1. /etc/profile
This file is modified by the administrator and is used to setup
the environment which is specific to both the operating system
and the administrator's implementation of it.
2. $HOME/.bash_profile
This file is called after the system wide /etc/profile. The
file is located in the users home directory and is used to
personalize and change enviroment settings as needed by the
individual user. The .bash_profile may call the .bashrc
file located in the users home directory (this is popular on
the RedHat linux variants).
3. $HOME/.bashrc
This file is used to setup aliases and functions. It is located
in the users home directory and is editable by the user as needed.
The .bashrc file often calls the system wide bashrc file located
in the /etc directory. It does not have the initial period before
its name.
4. /etc/bashrc
This system wide file is used in a similar way as the system wide
/etc/profile configuration file. It is used to setup alias and
functions which are specific to the administration's setup.
*. $HOME/.bash_logout
This file is executed when a user logs out of the system. Most
often it calls the clear command for a clean logout (in case
you don't close the terminal after logout).