environment variable Extension:
The difference between/etc/profile,/ETC/BASHRC,. Bash_profile and. BASHRC
When the user logs on to the Linux operating system, "/etc/profile", "~/.bash_profile" and other configuration files will be automatically executed.
Execution Process--
Start "/etc/profile" first,
The "~/.bash_profile" in the user directory is then launched, and the "~/.bash_login" and "~/.profile" files are called in turn after they are executed "~/.bash_profile" if they exist.
/etc/profile: This file sets the environment information for each user of the system, and when the user first logs on, the file is executed and the shell's settings are collected from the settings file of the/ETC/PROFILE.D directory;/ETC/BASHRC: Run bash for each The shell user executes this file, and when the bash shell is opened, the file is read; ~/.bash_profile: Each user can use the file to enter shell information dedicated to their own use, and when the user logs in, the file executes only once! By default, he sets some environment variables to execute the user's. bashrc file, ~/.BASHRC: The file contains bash information dedicated to your bash shell, which is read when logged in and every time a new shell is opened; ~/.bash_logout: When the file is executed each time it exits the system (exiting the bash shell),/etc/profile is a global feature in which variables set in all user ~/.bash_profile can inherit variables from the/etc/profile and be used for the user. ~/.bash_profile is interactive, login way into bash run, ~/.BASHRC is interactive non-login way into bash run
Linux environment variable problem