Setting your Unix Search Path
When you type a command to the UNIX shell, it searches a sequence of directories to look for an executable of that name. The sequence of directories is called your
search path. The first matching executable is the one executed by the shell.
Your search path is specified by the value of the environment variable
PATH. When you change that variable, you change the way the shell find commands. By adding to the front of the variable, you can override the location of various commands in order to use other versions of them.
To add a directory
new-dir to the front of your UNIX search path, do the following
- For
csh, tcsh: Add the following to ~/.cshrc:
setenv PATH new-dir:$PATH
- For
sh, bash: Add the following to ~/.profile:
PATH=new-dir:$PATH
export PATH
If you don't know what shell you're using, try:
echo $SHELL
--
GeorgeFerguson - 05 May 2005