How to set, print, or list environment variables

environment variables, or ENV varables

=To set a environment variables=

Temporary

 * For bourne shells sh, ksh, bash
 * execute: VARNAME="value"; export VARNAME


 * For c shells csh. tcsh
 * execute: setenv VARNAME "value"

Permanent
Edit the ~/.bashrc to set the environmental variables permanently.

=Display environment variables= display/print/list environment variables


 * To list all environment variables
 * Execute: printenv


 * To print a specific environment variable
 * Execute: echo $Env_Var_Name
 * Example: echo $PATH

=Common environment variables=
 * MANPATH=/usr/local/share/man:/usr/share/man
 * HOSTNAME=localhost
 * SHELL=/bin/bash
 * TERM=xterm
 * XTERM_SHELL=/bin/bash
 * PATH=/usr/java/j2sdk1.4.2_01/bin:/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/bin/::/usr/local/sbin
 * EDITOR=/bin/nano
 * BASH_ENV=/home/zymos/.bashrc
 * INFOPATH=/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.16.1/info:/usr/share/gcc-data/i686-pc-linux-gnu/3.4.5/info
 * DISPLAY=:0.0
 * PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/qt/3/lib/

From HowTo Wiki, a Wikia wiki.