Website based on my experience working as System Administrator

LINUX INFORMATION WEBSITE

This site is dedicated to providing tutorials, help, guides and links for Linux users.
HOME PAGE
LINUX COMMANDS
   
   
   
   
   
   
   
   
   

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

 
Last Update: Jan 2003

HOME | CONTACT | FAQ'S | TRICKS & TIPS | WEIRD NEWS
This Material has been taken from different sources. Its free for anyone to use and reproduce.