linuxdot.org Linux Expo Birmingham 2002
Linux news | Newbie's Linux manual | Linux links | Link us
The Linux columns | Book reviews
  DistroWatch + TuxReports October 28, 2002

Contents | Previous | Next | Download

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 | Download

About us  
Latest stable kernel: 2.4.19 | Latest development kernel: 2.5.44
Copyright © 1998-2002 Linuxdot.org.
Linux ® is a registered trademark of Linus Torvalds.