[X] close window

PATH:

(As pertaining to the bash shell and shell scripting)

PATH: is a shell variable that tells the shell where to look for programs. The variable is first defined by default files '/etc/bash.bashrc' and '/etc/bash.bashrc.local' (if present), and is optionally refined or replaced in '~/.bashrc'.

You can determine what your path contians simply by displaying the variable using echo:

% echo $PATH
    .:/home/anewman/bin:/usr/local/bin:/opt/bin:/usr/bin:/usr/X11R6/bin:/bin 
This example first looks in '.' (current directory), then '/home/anewman/bin', '/usr/local/bin', and so on... If you have multiple versions of the same program, it will run the one that it finds first in the list.

You can add directories by issuing the below commands on the command-line, or by putting it '~/.bashrc' or pertinent shell script:

% export PATH=/new/directory:$PATH   # adds /new/directory to front
% export PATH=$PATH:/new/directory   # adds /new/directory at end

For more information man path.

Last Modified: Tue Sep 19 13:32:04 EDT 2006