(1)/etc/profile global (public) configuration. No matter which user, the file will be read during login. (2) This file does not exist in/ECT/bashrcubuntu, which corresponds to/ECT/bash. bashrc is also global (public). It reads the file no matter how it is executed during bash execution. (3 )~ /. Profile if Bash is executed in the login mode, read ~ /. Bash_profile. If it does not exist, read ~ /. Bash_login. If the first two do not exist, read ~ /. Profile. In addition, this file will be read when you log on in graphic mode, even if ~ /. Bash_profile and ~ /. Bash_login. (4 )~ /. Bash_login if Bash is executed in the login mode, read ~ /. Bash_profile. If it does not exist, read ~ /. Bash_login. If the first two do not exist, read ~ /. Profile. (5 )~ /. Bash_profileunbutu does not have this file by default. You can create a new file. This file is read only when Bash is executed in the form of login. This configuration file is usually configured to read ~ /. Bashrc. (6 )~ /. Bashrc read this file when Bash is executed in the form of non-login. If it is executed in the form of login, the file will not be read. (7 )~ /. Bash_logout, which is in the Longin format, will be read. That is to say, when you log out in text mode, the file will be read, and when you log out in graphic mode, the file will not be read. The following are some examples on the local machine: 1. When logging on to the graph mode, read:/etc/profile and ~ sequentially ~ /. Profile2. after logging on to the graphical mode, read:/etc/bash. bashrc and ~ in sequence when you open the terminal ~ /. Bashrc3. when logging on in text mode, read:/etc/bash. bashrc,/etc/profile and ~ in sequence ~ /. Bash_profile4. there are two cases from another user Su to this user: (1) if the-l parameter (or-parameter, -- login parameter) is included, for example, Su-l username, bash is lonin, which reads the following configuration files in sequence:/etc/bash. bashrc,/etc/profile and ~ /. Bash_profile. (2) If the-l parameter is not included, bash is non-login, which reads:/etc/bash. bashrc and ~ sequentially ~ /. Bashrc5. when logging out, or the user logging out of Su, if it is in Longin mode, Bash will read :~ /. Bash_logout6. When you execute a custom shell file, if you use the "bash-l a. Sh" method, Bash will read the rows:/etc/profile and ~ /. Bash_profile. If other methods are used, such as Bash. sh ,. /. sh, sh. sh (this does not belong to bash shell), it will not read any of the above files. 7. In the above example ~ /. Bash_profile. If the file does not exist, read ~ /. Bash_login. If the first two do not exist, read ~ /. Profile.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service