Linux under All files, at the login will also follow the login to read many configuration files. Learn some information before you introduce the reading order.
Shell type for user login
Log-in Shell
Log in normally via a terminal
Su-username
Su-l USERNAME
Non-sign-on shell
Shell in the following way
Su USERNAME
Terminal window opened by graphical terminal
Shell scripts that are executed automatically
Bash's configuration file
Global configuration file
/etc/profice,/etc/profile.d/*.sh,/etc/bashrc
User Personal Profile
~/.bash_profile,~/.bashrc
Profile type file function:
Setting environment variables
Run a command or script when a user logs on
Files of the BASHRC class:
Setting Local Variables
Defining command aliases
Logon Shell reads the order of configuration files at logon
/etc/profile--/etc/profile.d/*.sh--and ~/.bash_profile--~/.BASHRC--/ETC/BASHRC
The non-logon shell reads the configuration file in the order
~/.BASHRC--/ETC/BASHRC-/etc/profile.d/*.sh
Therefore, when you need to modify variables or aliases, you can modify different configuration files according to the order in which they are read.
Note: The current shell will not be affected when the second modification affects only the future login shell
This article from "Liang Childe" blog, please be sure to keep this source http://iyull.blog.51cto.com/4664834/1883446
Linux Basics-Read the configuration file order when a user logs on