Revision [20519]
This is an old revision of Path made by darkcity on 2012-02-06 14:25:49.
Linux Environment PATH variable
PATH defines a list of directories to search through when looking for a command to execute.
Understanding the Path Variable
As in DOS, the shell uses the PATH variable to locate a command. PATH contains a list of directories separated by colons :
Entering echo $PATH in Puppy 5.29 returns-
/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R7/bin:/root/my-applications/bin
Thus binary/executable/script file in the following directory can be called by only its name-
/bin
/usr/bin
/sbin
/usr/sbin
/usr/local/bin
/usr/X11R7/bin
/root/my-applications/bin
For example, entering mp starts mp text editor no need to specify /usr/bin/mp
Env
The command env will list all the Linux Environment variables.
To list a specific variable with the echo command, prefixing the variable name with a dollar sign. For example echo $PATH