1. System level
(a)/etc/profile: When a user logs on to the operating system, the first file of the user environment is customized and applied to each user who logs on
= = "This file generally calls the/ETC/BASH.BASHRC file
(b)/etc/environment: When logging in, use the second file to read the user's profile before setting environment variables for environment files
= = System-level files, which take effect only when logging into the Linux system, require the use of the source command or reboot the system
2, user-level (located in the home directory)
(a) ~/.profile: Each user can use the file to enter shell information dedicated to their own use, and when the user logs in, the file is executed only once. By default, the execute user's. bashrc file "recommends that the user's environment variables exist in this file"
= = because "Every login is performed only once", so when you need to modify it in the process of using it, use source to make it take effect immediately, or to re-open a shell and let it take effect.
Files in Linux that involve environment variables