How to Copy a File Path as Text from Mac Finder in Mac OS X
Advanced Mac users who need frequent access to a files complete path in macOS and Mac OS X may find themselves turning to the drag & drop Terminal trick or performing a variety of other tricks to copy an items path, but with Mac OS X 10.11 and later, there’s a new native Copy Pathname option built directly into the Finder. Just as it sounds, it will copy the complete pathname of a file or folder directly to the clipboard.
Copying File Paths from the Mac Finder
Using Copy Item as Pathname in Mac OS X Finder is really easy, here’s all you need to do to copy any items path name directly to the clipboard from anywhere in the file system:
- Navigate to the file or folder you wish to copy the path for
- Right-click (or Control+Click, or a Two-Finger click on trackpads) on the file or folder in the Mac Finder
- While in the right-click menu, hold down the OPTION key to reveal the “Copy (item name) as Pathname” option, it replaces the standard Copy option
- Once selected, the file or folders path is now in the clipboard, ready to be pasted anywhere
The copied pathname is always the complete path, it’s not relative.
As an example, choosing “Copy (file) as Pathname)” in the screen shot example on a file called com.apple.Boot.plist copies in the /Library/Preferences/SystemConfiguration/ folder (where OS X network settings are stored) will copy the following file path into the clipboard, which can then be pasted anywhere as so:
/Library/Preferences/SystemConfiguration/com.apple.Boot.plist
This is demonstrated in the video below:
Though this right-click Copy Pathname option is only available in the latest versions of OS X, there are other ways to copy a file path in all versions of Mac OS X, including with an Automator script, so if you’re not on the latest and greatest you can still get the same feature through the Service menu and the Automator trick..
If you find yourself frequently needing path information on the Mac, two other handy tricks are enabling the Path Bar, which is interactive or showing the complete path in the Finder window titlebars too, which will display the full path to the active folder where ever you are in the Finder within the titlebar.
Awesome find, thank you so much!
Thank You!!! This was a great find. I needed it. :)
This was a handy discovery. I might stress that the option key should be applied after the right-click menu appears. If you apply the option key before, then you get a different menu.
Yeah. Thanx Bro :-)
Hello? Is anyone still there after all that time!
I’d got this far using an Automator service but I still couldn’t quite get what I needed. Any ideas anyone?
I use file paths to create local links to files & folders, which I paste into electronic documents.
[I typically create some kind of to-do list and there’ll files all over my computer that I want to locally link to. I’ll put the links in which must have the form:
“file://” + “path-to-file-that-I-want”
I can get the path but I need to ‘prepend’ “file://” to it. Then select it, copy it, ⌘K, and embed the local path in the text.
Is there a cool way to do this automatically (Terminal, Automator?). Just in one step?
Thx for the good tip!
great solution and works here.
Hi, much thank for the tutorial. Regarding the mentioned “drag & drop Terminal trick,” I’m pulling my hair out trying to get that to work. I’m admittedly not very familiar with the Terminal, but your post and numerous others indicate that copying a file path from Finder to Terminal is as simple as dragging and dropping. I’m using macOS Sierra 10.12.3, and for the life of me I cannot get that ostensibly simple action to work. No matter what file I try to drag and drop onto the Terminal, the pathname never appears in the Terminal — even when I first hold the file over the Terminal window for a few moments to ensure the Terminal app is in the foreground before then dropping the file on the window. I have even tried clicking option+copy [file] as pathname with a file selected in Finder and then tried all of the several paste options available from the Edit dropdown menu in Terminal, but still nothing does the trick. Am I missing something? Much thanks for any light you can shed.
Fantastic tip – this has been a real pain for me coming from Windows where the current path can be trivially copied/pasted.
However, it only solves the first problem (copying the current path). How can I quickly paste that path in another Finder window to navigate there (in windows it’s paste and enter, and boom, you’re there)?
This is such a common action (especially when developing software) I can’t believe there is not an easy way.
thanks
That’s easy. Cmd+Shift+G inside a Finder window.
This is ludicrous. Why are these context menu selections hidden from view and only visible when you click “Option”? They should be immediately visible in the context menu itself.
Because it’s not the primary intended way of activating the command. You can copy the filename as text to the clipboard by pressing OPTION + COMMAND + C with the intended file(s) selected. In fact, if you’re going straight to Terminal, you can achieve the same effect with just COMMAND + C. (without also pressing OPTION, though, you’re also “carrying” more in your clipboard than just the file path, and it’s up to whatever program you paste into to contextually determine what to do with all that data.)
Thanks a lot! The tip on the website did not work for me… the right click options etc. Yours did work thank you
Good grammar is never gratuitous – quite the opposite. If one continues to utilize poor and incorrect grammar, the meaning of a post, thought, etc. may be misconstrued. Not to mention, it makes one appear to be uneducated. “File’s” used as “file is” is lazy and incorrect. “It” is the only word that differs; such is the English language when used correctly: rules don’t always follow, such as “i before e except after c.” “File’s” is, indeed, the possessive form of “file.” If one was discussing more than one file (“files), its possessive would be “files’). Trust us on this.
Great stuff but please use English:
“Advanced Mac users who need frequent access to a files complete path”
should read:
“Advanced Mac users who need frequent access to a file’s complete path” (Possessive)
How can you have “a files”?
You’re wrong Geoff.
‘s is a contraction of “is” like “it’s” is “it is”
So file’s is file IS, the quote is not saying “file is” it’s saying “files”
Next time you want to copy a complete path to your clippy board, think about that one.
By the way Geoff, I think you are spelling your name wrong too, it’s spelled “Jeff” just as it’s pronounced, not “Geoff” as in “GE OFF”. Please use American English in the future.
Sorry, Typical, you are wrong.
It’s and its are an odd example of possessive case and a contraction. “it’s” is a contraction of “it is”, as you say, while “its” is the possessive form, meaning belongs to it.
“The file’s complete path” is correct, this is the possessive form of the noun “file” and means the complete path belonging to “file”.
Generally, possessive forms of nouns are formed by using the apostrophe s (‘s). “its” is an exception to this.
You’re welcome. Not “Your welcome” nor “you’s welcome” :)
It’s is always a contraction:
it is = it’s
file’s = file is
Geoffs = Goeffs’ses
No, you are wrong. No less an authority than Wikipedia (and me!) says so:
https://en.wikipedia.org/wiki/Possessive#From_nouns
This is consistent with any grammar book you would like to take a look at.
The possessive form of a noun is generally created by adding ‘s to the noun, hence “file’s” is the possessive of file.
“it’s” is a contraction, “file’s” is not.
This’s all very interesting, but what does it all mean Basil?
Your GGP (gratuitous grammar policing) is not needed here. Stick to the threads about how to access emoji’s ¯\_(ツ)_/¯
Another excellent tip. Thanks people!
What is wrong with simply making an “Alias”? Been doing for many Years.
Using aliases for items is fine but unrelated for what the primary purpose intention is for copying a path, this is for users who need the exact printed path of a file or folder, usually for Automator or use in the Terminal.