Copy and paste the full path of a file in the Finder
This is a handy trick that I use from time to time. Say you’ve selected a file or folder in a Finder window, and you want to copy the full path to that file or folder as a text string – for pasting into an email or a script, for example. Here’s how:
- Open a Terminal window.
- Drag the file or folder to the Terminal window. (The full path appears in the window.)
- Select the path in the Terminal window, copy it, and paste it into your email or script.
- Close the Terminal window.
The only slight snag is that, if your file or folder path contains spaces, the spaces get escaped with ‘\’s in the Terminal window.
If the escaped spaces bug you, or you often want to copy the path to a file, check out the catchily-titled FilePathToClipCMPlugin. Download and open the .dmg, drag the FilePathToClipCMPlugin.plugin file to ~/Library/Contextual Menu Items, and restart the Finder (Apple menu > Force Quit, then choose Finder in the list and click Relaunch). You can now right-click any file or folder and choose FilePathToClip! to copy it to the Clipboard. Works a treat.
(PathSnagger does a similar thing, but sadly it doesn’t have a stable Universal Binary version yet so I can’t test it.)
January 2nd, 2008 at 5:07 am
Word 04 for Mac doesn’t paste in full paths for file hyperlinks (and there’s no support doc addressing this that I could find anywhere, so this saves the day,
thanks.
September 7th, 2009 at 4:23 am
Super!!!
It realy works!!!
September 15th, 2009 at 9:25 am
here’s a weird thing that’s happening to me, that seems semi-related: every time i try to paste something from word (using mac office 2004) to firefox it pastes the full file path before the text i’m trying to paste. anyone have this happen before and know how i can fix it? i’m stumped…
thanks!
aaron
September 18th, 2009 at 12:59 pm
@aaron: Sounds strange. The full file path to the Word doc? Does it happen with other browsers?
February 13th, 2010 at 12:58 am
Works. But rather lame that one has to do it this way. :-/
May 23rd, 2010 at 4:53 pm
really lame….why is that every simple thing in mac needs extra plugins..?? Plugin for right click menu, plugin for simple path copying..plugin for home/end keys…plugin to show USB devices…I’m really missing my windows days..
June 2nd, 2010 at 3:18 pm
@ravi: There’s no doubt that Mac OS X trades usability for features – often you need to use plugins or go “under the hood” to do some of the things that are more front-and-centre in Windows. Personally I like the tradeoff and love my Mac’s uncluttered UI and ease of use, but it’s not for everyone!
July 26th, 2010 at 9:30 pm
Actually you can ‘right-click’ to the folder > ‘get info’
the folder path is located in ‘Where:’ under ‘General info.
then you can copy the path.
July 29th, 2010 at 8:20 pm
Nice find Kamil! 🙂 I don’t think the “Where” field in the Get Info dialog was copyable in 10.4 (which was the current OS X when I wrote the post), but it is in 10.6. Very handy!
October 30th, 2011 at 6:47 pm
Jesus that is laborious, why wouldnt finder integrate that? or at least a 3rd party up facilitate it. Apple have dropped the ball on this and cut/paste issue.
July 30th, 2012 at 3:00 pm
[…] via: Copy and paste the full path of a file in the Finder — Reality Distortion: Macs, Mac OS X, and…. Rate this:Share this:LinkedInTwitterFacebookStumbleUponDiggRedditEmailPrintLike this:LikeBe the first to like this. […]