Adding a directory to your $PATH

Status
Not open for further replies.

Osiris

Golden Master
Messages
36,817
Location
Kentucky
Source Adding a directory to your $PATH

In the Linux operating system the $PATH is a listing of all directories where the system will look for commands. What this means is that all of the commands located in the directories included in your path will be globally executable. For example: The /usr/bin directory contains quite a lot of commands that can be excuted from within any directory on your system. Because of this you can issue the ls command from within any directory and get the listing of the contents of that directory. If the ls command wasn't in a directory in your path you would have to include the explicite path to that command (i.e. /usr/bin/ls).
As a Linux user you can add directories to your $PATH. This is helpful when you don't want to add a command to a directory in your $PATH but you want that command to be globally executable. Doing this is actually quite easy.
 
Status
Not open for further replies.
Back
Top Bottom