Operation Manual

alias lt='ls -ltr'
To view all alias denitions, use alias. Remove your alias with unalias.
22.5 Using Variables in Bash
A shell variable can be global or local. Global variables, or environment variables, can
be accessed in all shells. In contrast, local variables are visible in the current shell only.
To view all environment variables, use the printenv command. To see the value of
a variable, insert the name of your variable as an argument:
printenv PATH
A variable, be it global or local, can also be viewed with echo:
echo $PATH
To set a local variable, use a variable name followed by the equal sign, followed by the
value:
PROJECT="SLED"
Do not insert spaces around the equal sign, otherwise you get an error. To set an envi-
ronment variable, use export:
export NAME="tux"
To remove a variable, use unset:
unset NAME
The following table contains some common environment variables which can be used
in you shell scripts:
Table 22.5
Useful Environment Variables
the home directory of the current user
HOME
the current hostname
HOST
348 Reference