Show all enviroment variables
Command:env
Show local environment variables
Command:set
Append environment variables
The most common usage is to append directories that contain executable files into environment variable PATH
Editing .bashrc(or .bash_profile) file in your home directory is good choice. Then you can execute command: source .bashrc, to force it to take effect.
For example:
#Add hadoop and java environment:
JAVA_HOME=/usr/local/jdk1.6.0_13
export PATH=$JAVA_HOME/bin:$PATH
#hadoop
export HADOOP_JAR=$HADOOP_HOME/hadoop-0.19.1-core.jar
export HADOOP_ROOT=/usr/local/hadoop/hadoop-0.19.1
export HADOOP_HOME=$HADOOP_ROOT
export HADOOP_CONF_DIR=$HOME/hadoop_conf
export JAVA_HOME=/usr/local/jdk1.6.0_13
export PATH=$HADOOP_HOME/bin:$HOME/online/hive/hive-lib/bin:$JAVA_HOME/bin:$HOME/bin:$HOME/online/bin:$PATH