HomePage > Components and HowTos > CommandLine

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

Also see
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki