Skip to content

Mac file guides

How to copy a file path on a Mac

By · Updated · 3 min read

Short answer

Select the file in Finder and press ⌥⌘C. Or right-click it, hold Option, and choose “Copy … as Pathname”. Either puts the full path, like /Users/you/Documents/report.pdf, on the clipboard. To paste a path into Terminal, you can also drag the file into the Terminal window.

How do I copy a path in Finder?

  1. 1Select the file or folder.
  2. 2Press ⌥⌘C. The full path is now on the clipboard.
  3. 3Or right-click it, hold Option, and choose Copy “name” as Pathname.

How do I see a file’s full path?

  • View › Show Path Bar (⌥⌘P) shows the folders above the selected item at the bottom of the window. Double-click any of them to open it.
  • Get Info (⌘I) shows the containing folder next to Where.
  • Command-click the folder name in a Finder window’s title bar to see the path as a menu.

How do I get a path in Terminal?

Drag a file from Finder into a Terminal window and its path is typed for you, with spaces escaped. Or copy it from Terminal:

realpath report.pdf | pbcopy

Why does my path have “~” or backslashes?

~ is shorthand for your home folder (/Users/you). Backslashes escape spaces and other special characters so Terminal reads the path as one argument. Finder’s Copy as Pathname gives the plain path, which you may need to wrap in quotes in Terminal.

Paths in Peekaboo

In Peekaboo, right-click any file and choose Copy Path, or select several and copy all their paths at once. The inspector (⌘I) shows the full path under More Info. With developer features on, Copy Path As also gives a Terminal-ready path with spaces escaped, or a file:// URL, and Open in Terminal opens the folder right there.

  1. 1Right-click a file › Copy Path.
  2. 2See the full path in the inspector.⌘I

Questions

What is the shortcut to copy a file path on a Mac?

⌥⌘C (Option-Command-C) in Finder, with the file selected.

How do I copy a path for a file in iCloud Drive?

The same way. The path points into ~/Library/Mobile Documents/com~apple~CloudDocs, which is where iCloud Drive lives on disk.

How do I open a folder from a path?

In Finder choose Go › Go to Folder (⇧⌘G), paste the path and press Return.

Your privacy choices

With your permission, Google Analytics measures visits to this site using cookies. Privacy policy.