1. classfys according to the range in which configuration files take effect.
1.1 The global configuration file
/etc/profile :
/etc/profile.d/*.sh
/etc/bashrc :
1.2 The personal configuretion file
~/.bash_profile
~/.bashrc
2. classfys according to its function
profile : Provides configuration for shell which logins interactively
global : /etc/profile :
/etc/profile.d/*.sh
personal : ~/.bash_profile
function :
1) used to define environment variables
2) used to run commands and scripts
bashrc : Provides configuration for shell which logins non-interactively
global : /etc/bashrc
personal : ~/.bashrc
function :
1) used to define aliases
2) used to define location variables(本地变量)
3. shell login
3.1 interactive login
The order of loading configuration files is /etc/profile --> /etc/profile.d/*.sh --> ~/.bash_profile --> ~/.bashrc --> /etc/bashrc
3.2 non-interactive login
The order of loading configuration files is ~/.bashrc --> /etc/bashrc --> /etc/profile.d/*.sh
4. source : Read and execute commands from FILENAME in the current shell