Ubuntu Set shell environment variables
To open a configuration file:
Vim ~/.BASHRC
At the end of the file, add the following
Export variable name = variable
As:
Export Java_home=/usr/lib/jvm/java-6-sun
Export path= $PATH: ~/mybin
Log off and log on again, and the new environment variable takes effect.
There are several files in the http://www.aliyun.com/zixun/aggregation/13835.html ">ubuntu" that can set environment variables
/etc/profile: The first file that is used when the operating system customizes the user's environment at logon, which sets the environment information for each user of the system, and when the user first logs on, the file is executed.
/etc/environment: The second file that is used by the operating system at logon, the system sets the environment variable for the environment file before reading your own profile.
~/.profile: The third file that you use when you log on IS. Profile files, which each user can use to enter shell information dedicated to their own use, which is executed only once when the user logs on! By default, he sets some environment variables to execute the user's. BASHRC files.
/ETC/BASHRC: This file is executed for each user running the bash shell. When the bash shell is opened, the file is read.
~/.BASHRC: This file contains bash information dedicated to your bash shell, which is read when you log in and each time you open a new shell.