32

In Windows it is possible to right-click on a file. Then select "properties". In "properties" the file-system path is shown. Can then be copied by marking and storing (into the clipboard).

I couldn't figure out a way to do that in Mac.

Therefore my question:

Can I retrieve the file-system path of a directory or file via the GUI of the Mac Finder?

63
+50

Ctrl-click (or two finger click) on the file you want the path from, then press Opt and select "Copy as path name" (or what it's called in english) from the context menu.

You can also just select the file and then press Opt-Cmd-C to copy the pathname to the clipboard.

  • 3
    Wow, I had no idea! – Alan Shutko Sep 10 '16 at 14:23
  • 2
    *ding* That was the sound of an old dog learning a new trick. – Ɱark Ƭ Sep 10 '16 at 15:26
  • 2
    This does not work with versions of OS X prior to OS X 10.11. – user3439894 Sep 10 '16 at 16:14
  • Holding <kbd>Option</kbd> reveals so many hidden/alternative menu options. – Matt Sephton Jul 5 '18 at 11:06
6

I don't see a way to do it with just Finder. The best I could do is:

  1. Open a Terminal window.
  2. Drag the file you want into terminal.
  3. Select the filename in the terminal window.
  4. Copy the filename to the clipboard.

Safari will also work. It's a file URL, so you will have to be careful with your selection.

  • You can also drag the file into a TextEdit window (in plain text mode)… that might be less dangerous. – Sam Sep 10 '16 at 17:05
  • Haven't know that Drag and Drop ability of Mac OS. Thanks a lot. Your answer was definitely helpful for me too. – mizech Sep 11 '16 at 7:55
2

You can drag the file or folder from Finder application to the dialog box. The full path of the file or folder will appear in the dialog box. Additionally, you can drag a file or folder into the Terminal application or many other apps, to expand the path.

Also, if you enable showing the Path Bar in the Finder application, then you can drag any part of the full path to a dialog box. The Path Bar can be enabled by selecting View➔Show Path Bar from the menu bar or by using the option++P key combination.

1

I love the control / option copy as path trick, but can never seem to remember it, so I end up using Finder services menu to let you extend this function. By design, Apple only shows a path for network share files in the get info pane so you'll need to attach a service to Finder to get this in general (for reasons, I'm sure I'd love to hear over a drink).

That being said, I use Path Snagger 2 and am super happy with it as I can control POSIX/SMB/HFS and file://whatever format for the path that gets copied. You can process several files at once, control all sorts of tweaks to how the path is constructed. I also don't have to do multiple clicks and I copy off paths all the time so it's worth the expense to me.

I could see making an AppleScript or swift script to do this for free as well if you had a well defined string you wanted to get from the location of a specific file that would be general to all files once you coded it. This would only be good if you didn't know to connect it to services for quicker execution than the built in way or needed a different format for the path.

0

I'm using macOS Mojave. It's easy to find what you want, just go to folder and click on gear icon on top of window, there you can see option called "Copy 'folderName' as Pathname" That is it!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .