$PATH variable in Unix

One of the most important variables in Unix is the PATH variable.

Set your PATH variable to store the directories where your executables are stored. Most common executables like 'ls, pwd, cat' are stored in /bin directory.  Therefore on a normal Unix flavour,  the $PATH? will result in following output.

$echo $PATH?
/bin: /usr/bin

The PATH variable decided where the Unix system must start looking for the executables once any command is entered on the terminal. Colon: is used as a separator to separate two directories.

If you wish to run any other executable form any directory,  you must first add the directory in PATH variable.  This tells Unix where exactly it needs to look for the executable.

No comments :

Post a Comment