List of Shell Environment Variables

Shell Environment variables :

Shell Variables and Environment Variables.

Every UNIX process runs in a specific environment. An environment consists of a table of environment variables, each with an assigned value. When you log in, certain login files are executed. They initialize the table holding the environment variables for the process.



[bibblio style=”bib–row-3 bib–default bib–hover bib–white-label bib–font-arial bib–size-18″ query_string_params=e30=]

Login to the Linux Terminal  and try the follow example of the understanding of the shell Environment variables

a) printenv command – Print all or part of environment.

b) env command – Print all exported environment or run a program in a modified environment.

c) set command – Print the name and value of each shell variable

[bibblio style=”bib–row-3 bib–default bib–hover bib–white-label bib–font-arial bib–size-18″ query_string_params=e30=]

System Variable

MeaningTo View Variable Value Type
BASH_VERSIONHolds the version of this instance of bash.echo $BASH_VERSION
HOSTNAMEThe name of your computer.echo $HOSTNAME
CDPATHThe search path for the cd command.echo $CDPATH
HISTFILEThe name of the file in which command history is saved.echo $HISTFILE
HISTFILESIZEThe maximum number of lines contained in the history file.echo $HISTFILESIZE
HISTSIZEThe number of commands to remember in the command history. The default value is 500.echo $HISTSIZE
HOMEThe home directory of the current user.echo $HOME
IFSThe Internal Field Separator that is used for word splitting after expansion and to split lines into words with
the read builtin command. The default value is <space><tab><newline>.
echo $IFS
LANGUsed to determine the locale category for any category not specifically selected with a variable starting with LC_.echo $LANG
PATHThe search path for commands. It is a colon-separated list of directories in which the shell looks for commands.echo $PATH
PS1Your prompt settings.echo $PS1
TMOUTThe default timeout for the read builtin command. Also in an interactive shell, the value is interpreted as
the number of seconds to wait for input after issuing the command. If not input provided it will logout user.
echo $TMOUT
TERMYour login terminal type.echo $TERM
export TERM=vt100
SHELLSet path to login shell.echo $SHELL
DISPLAYSet X display nameecho $DISPLAY
export DISPLAY=:0.1
EDITORSet name of default text editor.export EDITOR=/usr/bin/vim




Leave a Reply

Your email address will not be published. Required fields are marked *