Features |
Timeliness |
range |
|
/etc/profile |
Setting environmental information. And from /etc/profile.d collect configuration file directory shell settings . Only when the user first logs in, the file is executed. |
Modify the restart to take effect |
Overall situation (All users) |
/etc/bashrc |
When the user opens each new bash shell when the file is read. |
Do not restart, effective immediately |
Overall situation |
~/.bash_profile |
By default, he set some environment variables , execute the user's ~ / .bashrc file . Only when the user first logs in , the file is executed . |
Modify the restart to take effect |
Partial (Single user) |
~/.bashrc |
When users log in every time, the newly opened bash shell when the file is read. |
Do not restart, reopen a bash to take effect |
Partial |
~/.bash_logout |
When the system each time you exit (exit bash shell when) , the file is executed |
|
Partial |
Similarities and differences: Global and local general parent-child inheritance
~ / .bash_profile interactive, Login way into bash running; (SSH) ~ / .bashrc interactive non-login way into bash running; ( vncserver ) The former usually calls the latter. |