How To Wiki

How to set, print, or list environment variables

1,793pages on
this wiki

environment variables, or ENV varables

To set a environment variablesEdit



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

Display environment variablesEdit

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 variablesEdit

  • 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.

Around Wikia's network

Random Wiki