The PATH variable


show more The PATH variable provides you with in-depth training on IT. Taught by Kevin Skoglund as part of the Unix for Mac OS X Users show less
please wait ...

The PATH variable

In the last movie, we saw how commands and programs are really just files that are being executed, and we saw that we type echo 'Hello world' that what it's actually doing is executing a file that is located in bin/echo. I write the argument. Those are doing exact same thing. This is just a shortcut for finding this file and executing it. So how does Unix do that? How does Unix know to find echo in this location or to put it another way, if I create another file named echo, how does Unix know not to use that one instead, or what if I wanted it to use that one instead? How would I go about doing that? Well, the way that Unix manages all of this is with a variable called PATH.

$PATH will show you the current value of your path and the path is always a colon-separated list of file paths and this is the list that Unix will use when trying to locate commands to execute. The early entries take precedence over the later ones. So what it does is it starts at the left. When we type echo, ...

The PATH variable
Video duration: 4m 13s 6h 35m Beginner

Viewers:

The PATH variable provides you with in-depth training on IT. Taught by Kevin Skoglund as part of the Unix for Mac OS X Users

Subject:
IT
Software:
Mac OS X Unix
Author:
please wait ...