LINUX
COMMANDS
Contents | Previous
| Next
Environment variables
Environments variables allow you to customise your
shell. To list them, enter:
env
...or for a complete list, enter:
set
$HOME
Stores the absolute path to your home directory. To display,
enter:
echo $HOME
$PATH
When a command or program, like tree is entered
at the command-prompt, the shell looks to see if it can
find it in the directories listed in your path. If
it can't, it will display the message:
bash: tree: command not found
To display your path, enter:
echo $PATH
...to display something like:
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/john/bin
These six directories, separated by a colon (:),
is your path.
Intermediate Tip:
To add to your path, open the file ~/.bash_profile
in a text editor, and to the line:
PATH=$PATH:$HOME/bin
...add something like:
PATH=$PATH:$HOME/bin:$HOME/programs
...to add the directory /home/john/programs to
your path, the next time you log-in.
$SHELL
Stores the absolute path of your shell. To display, enter:
echo $SHELL
Contents | Previous
| Next