In the Linux system, there are/ETC/PROFILE,/ETC/BASHRC, ~/.BASH_PROFILE,~/BASHRC these four configuration files, these files, will be automatically loaded at some point, that is, a little bit, usually are some aliases, special variables inside. Four have the loading order, the first load is the etc beginning of the/etc/profile, then the/ETC/.BASHRC, some versions are not/ETC/.BASHRC already, these two are called the global, and then
The profile BASHRC under the home directory will be loaded according to the logged-in user. Why is it so loaded for a reason?
If the global settings a=1, your home directory itself set a=2, to the local, that is, a=2, because it after loading, will overwrite before setting this is the order, when loading, all the profile files, only in the boot load once, All BASHRC files are loaded once each time a new shell is opened.
Shell scripts, the configuration file load order, and when to load.