Linux learning record---environment variable configuration file---function

Linux has a certain order for calling the environment variable configuration file, and there are two cases of user login and no user login.
If there is a user login, the order in which Linux calls the environment variable file is as follows:
1. First call the /etc/profile file The main work in this file is to initialize the USER variable, LOGNAME variable, MAIL variable, PATH variable, HOSTNAME variable, HOSTNAME variable, HISTSIZE variable, umask variable, etc., and then call /etc/profile in this file. d/*.sh file, /etc/profile.d/*.sh file, mainly calls /etc/profile.d/lang.sh file, and this file mainly defines the locale of the system, by calling /etc/sysconfig /i18n to initialize the system locale.
2. After calling the /etc/profile.d/*.sh file, the system will call the ~/.bash_profile file, this file will call the ~/.bashrc file, and the ~/.bashrc file will be called again. The /etc/bashrc file will be called. At this time, if it is the operation of the logged-in user, the system will enter the command line prompt, and the initialization of the environment variables is completed.
3. If the environment variables belonging to non-login users are initialized, the /etc/bashrc file needs to be When performing the operation of the non-login user, the operation on the initialization of the environment variable of the non-login user in /etc/bashrc will be called. The main step is to call /etc/profile.d/*sh-->/etc/profile.d/lang. sh/etc/sysconfig/i18n and other files to initialize environment variables.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326121487&siteId=291194637