Friday, April 8, 2016

The PATH variable

PATH variable is colon delimited list of directories that UNIX uses to locate a command for execution.

To see the contents of the PATH variable we can echo the same

echo $PATH

























When we run a command say ls -lrt, UNIX would check the paths provided in the PATH variable one by one and locate the command and execute the same.
In this case ls is present in the /bin directory.

This can be found using the which command:

which ls
/bin/ls







No comments:

Post a Comment