If this bothers you, just select the path normally instead of triple-clicking.) One important thing to keep in mind here is that Snow Leopard (Mac OS X 10.6) and earlier systems behave a little differently. If you enter the path to a file, rather than a folder, on later systems, the file will be displayed in the Finder.
Attempt to edit your path only if you have advanced skill; if you'reunsure of how to safely do it, consult your system administrator. Ifyou are a student, faculty member, or staff member at Indiana University, youmay also want to contact your class instructor or yourdepartment's computing support provider.
The PATH environment variable is a colon-delimited list ofdirectories that your shell searches through when you entera command.
Program files (executables) are kept in many different places on theUnix system. Your path tells the Unix shell where to lookon the system when you request a particular program. Having moredirectories in your path will reduce the number of times you get'Command not found' errors, but might put you at greater risk ofactivating a Trojan horse.
![Software Software](http://cdn.osxdaily.com/wp-content/uploads/2013/06/copy-file-folder-path-service-mac-os-x.jpg)
To find out what your path is, at the Unix shell prompt, enter:
Your path will look something like the following.
You will see your username in place of
username
. Usingthe above example path, if you enter the ls
command, yourshell will look for the appropriate executable file in the followingorder: first, it would look through the directory/usr2/username/bin
, then /usr/local/bin
,then /usr/bin
, and finally the local directory, indicatedby the .
(a period).To modify your path
If you are using
csh
or tcsh
, at the shellprompt, enter:If you are using
sh
, ksh
, orbash
, at the shell prompt, enter:In all cases, replace
/dir/path
with the directory youwant the shell to search.Earlier entries in the path take precedenceover later ones. If you want the directories you add to yourpath to take precedence, in the examples above, replace
$PATH:/dir/path
with /dir/path:$PATH
.To make these changes permanent, add the commands described above tothe end of your
.cshrc
file (for csh
andtcsh
), .profile
file (for sh
and ksh
), or .bash_profile
file (forbash
).At Indiana University, for personal or departmental Linux or Unix systems support, see Get help for Linux or Unix at IU.
Mac OS X doesn’t have an obvious way to view the exact text based path to a folder (otherwise known as a directory) in the finder window. You can have it show a graphical path, but getting just the text based path to a directory (for use in the Terminal for example) requires a couple of extra steps.
Yosemite users special note
Apple removed the ability to easily copy the file path in OS X Yosemite. Yosemite users must now follow a complicated procedure of creating a Service to do this simple task or take the path directly from the command line.
El Capitan - Built in file path copy function
If you are a El Capitan user you are in luck, Apple has now created a specific command to capture the file path. Instructions on how to use this can be found here.
Mavericks and below - How to find the Absolute Path to a folder on Mac OS X
Here are the instructions for finding the file path on Mavericks and below...
The first thing to do is identify the folder you need to know the full path for. In this example it’s the “month 1″ folder of my Insanity Workout folder (and yes, I did buy Insanity, directly from Amazon actually and these are my back-ups. It’s not pirated like so much Beachbody stuff unfortunately is!):
Now we can simply press the “cmd+i” keys together to open up the “Get Info” window. This displays various bits of info about the folder as you can see below:
You can see that the Get Info window contains the line “Where:” followed by the text folder path. This is the path to the folder we have been looking for. The path to the folder is highlighted and made clearer in the screenshot below:
You can now copy this text based absolute folder path and paste it into your Terminal window. NOTE – If the directory path contains spaces, as the example i have used in this post does, you MUST use ” quotation ” marks around the path when typing it into the Terminal. The screenshot below demonstrates this:
Why might I need to know how to find the path to a folder on Mac?
Knowing the text based absolute path to a folder can be useful for a number of reasons. Being able to locate the precise path allows you to unlock the full power of the Terminal, which can often be faster and more efficient that using the Graphical User Interface.
Mac OS X doesn’t have an obvious way to view the exact text based path to a folder (otherwise known as a directory) in the finder window. You can have it show a graphical path, but getting just the text based path to a directory (for use in the Terminal for example) requires a couple of extra steps.
Yosemite users - special note
Apple removed the ability to easily copy the file path in OS X Yosemite. Yosemite users must now follow a complicated procedure of creating a Service to do this simple task or take the path directly from the command line.
El Capitan - Built in file path copy function
If you are a El Capitan user you are in luck, Apple has now created a specific command to capture the file path. Instructions on how to use this can be found at teh link below:
Mavericks and below - How to find the Absolute Path to a folder on Mac OS X
Here are the instructions for finding the file path on Mavericks and below...
The first thing to do is identify the folder you need to know the full path for. In this example it’s the “month 1″ folder of my Insanity Workout folder (and yes, I did buy Insanity, directly from Amazon actually and these are my back-ups. It’s not pirated like so much Beachbody stuff unfortunately is!):
Now we can simply press the “cmd+i” keys together to open up the “Get Info” window. This displays various bits of info about the folder as you can see below:
You can see that the Get Info window contains the line “Where:” followed by the text folder path. This is the path to the folder we have been looking for. The path to the folder is highlighted and made clearer in the screenshot below:
You can now copy this text based absolute folder path and paste it into your Terminal window. NOTE – If the directory path contains spaces, as the example i have used in this post does, you MUST use ” quotation ” marks around the path when typing it into the Terminal. The screenshot below demonstrates this:
Why might I need to know how to find the path to a folder on Mac?
Knowing the text based absolute path to a folder can be useful for a number of reasons. Being able to locate the precise path allows you to unlock the full power of the Terminal, which can often be faster and more efficient that using the Graphical User Interface.