分类: LINUX
2015-02-09 15:35:53
Login shells read one or more startup files as shown below:
File |
Contents |
/etc/profile | A global configuration script that applies to all users. |
~/.bash_profile | A user's personal startup file. Can be used to extend or override settings in the global configuration script. |
~/.bash_login | If ~/.bash_profile is not found, bash attempts to read this script. |
~/.profile | If neither ~/.bash_profile nor ~/.bash_login is found, bash attempts to read this file. This is the default in Debian-based distributions, such as Ubuntu. |
Non-login shell sessions read the following startup files:
File |
Contents |
/etc/bash.bashrc | A global configuration script that applies to all users. |
~/.bashrc | A user's personal startup file. Can be used to extend or override settings in the global configuration script. |
In addition to reading the startup files above, non-login shells also inherit the environment from their parent process, usually a login shell.