http://blog.csdn.net/cscmaker/article/details/7261921
Environment variables in Linux include system-level and user-level, system-level environment variables are system variables to be read by every user logged into the system, and user-level environment variables are the environment variables that are loaded when the user uses the system. Therefore, the management environment variable files are also divided into system-level and user-level, the following posted on the Internet to find a more clear description of the document (slightly modified) [1]:
1. System level: (1)/etc/profile: This file is the first file used by the operating system to customize the user environment when the user logs on, and is applied to every user who logs on to the system. This file is typically called the/ETC/BASH.BASHRC file. /ETC/BASH.BASHRC: System-level BASHRC file. (2)/etc/environment: The second file that the operating system uses when logging on, the system sets environment variables for environment files before reading your own profile.
2. User-level (these files are in the home directory): (1) ~/.profile: Each user can use the file to enter the shell information dedicated to their own use, when the user logs on, the file is only executed once! By default, he sets some environment variables to execute the user's. bashrc file. here is where personal settings are recommended (2) ~/.BASHRC: This file contains bash information dedicated to your bash shell, which is read when you log in and every time you open a new shell. It is not recommended to put it here, because every time you open a shell, the file will be read once and the efficiency must be affected. ~/.bash_profile or ~./bash_login: There is no reference to the author, the following will be mentioned ~/.pam_environment: User-level environment variable settings file, did not test, do not know whether the tube is used.
Through the above file introduction, we can understand that we need to set the environment variables when the need to modify what files, in order to be effective for all users, it is necessary to set the system-level environment variables. Conversely, you need to modify the user-level files (preferably modify the. profile file for the reason above).
Http://www.cnblogs.com/mengyan/archive/2012/09/04/2669894.html
environment variable files and configuration in Linux