Check the PATH of your Mac with echo $PATH

Aug 31, 2010 - Leave a Comment

Anytime that you run a command through the Terminal directly by a command name like ls or dscacheutil, your Mac is looking through a series of directories for that command to exist. This list of directories is called the PATH, and it’s a carry over from the unix underpinnings of Mac OS X. As you may have guessed, checking your PATH in Mac OS X is the same as it is in most other unix variants:

echo $PATH

Executing that command, you’ll see something like:
$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

The directories listed are those that are searched for commands. So the next time someone asks you if a directory is in your path, now you know where to look.

Related articles:

Posted by: Manish Patel in Command Line, Mac OS X

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Shared on Facebook

Shop at Amazon

Ad

OSXDaily on Facebook