Friday, February 24, 2017

How to copy a file path on a Mac

This is obscure, but I ran across this recently and thought it might help someone else out. I frequently need to copy the path to a file on my Mac or on a server, so that I can include that path in documentation or in a support email with a customer. Here’s how to do it:

1. Select the file you want in the Finder

2. Choose File > Get Info (command-i)

3. Select the full path next to “Where” in the Get Info dialog box

Screenshot 2017 02 24 08 47 46

4. Choose Edit > Copy (command-c)

The file path is now on the clipboard, and can be pasted into a text document or an email. The path will look like this after pasting:

/Users/keithgilbert/Dropbox/Stock/Vector/Open Clipart Library/openclipart-0.18-svgonly/clipart/education

UPDATE:

I just discovered by reading Dan Rodney’s excellent list of Mac Keyboard Shortcuts that if you select a file in the finder and press command-option-c the path name is copied. This method also puts the filename on the end of the path, so in my example above, the result is:

/Users/keithgilbert/Dropbox/Stock/Vector/Open Clipart Library/openclipart-0.18-svgonly/clipart/education/logaritmic_diagram_01.svg

YET ANOTHER UPDATE:

Jamie McKee at MacKey Composition alerted me to this: You can right-click on a file or folder in the Finder, and then hold down the option key and choose “Copy [filename] as Pathname”. 

Wow. I had no idea there were so many ways to do this. Good to know!