Copy File Path on macOS: 4 Ways
Copying a file path on macOS is easy: select the file in Finder, press Command+Option+C to copy its full path as text, or use Get Info (Command+I) and copy the path from the “Where” field. You can also drag the file into a Terminal window to paste its path automatically. This guide covers all the built-in methods, what each one gives you, and how to avoid common pitfalls.
Why Copy a File Path?
You often need a file’s exact location when writing scripts, configuring apps, or sharing a location with a colleague. For example, a developer might need /Users/name/Documents/project/config.json to point a tool at the right file. A support person might ask for the full path of a log file so they can debug an issue. Instead of typing it manually (and risking typos), macOS gives you several ways to copy the path directly from Finder.
Method 1: The Quickest Way – Command+Option+C
This is the fastest built-in method and works in most macOS versions (from OS X 10.5 onward).
- Open Finder and navigate to the file or folder.
- Click once to select it (don’t open it).
- Press Command+Option+C.
The clipboard now contains the full POSIX path, for example: /Users/name/Documents/report.pdf. Paste it anywhere with Command+V. This works for files, folders, and even items on the Desktop.
Method 2: Get Info Window
If you prefer a visual interface, use the Info window.
- Select the file in Finder.
- Press Command+I (or right-click → Get Info).
- In the window that opens, look at the General section. You’ll see a row labeled Where: showing the parent folder path (e.g.,
/Users/name/Documents). - Right-click that path and choose Copy.
This gives you the folder path, not the file name. To get the full file path, you’d add the file name yourself. For a copyable full path, use Method 1 or Method 3.
Method 3: The Path Bar in Finder
Finder’s path bar shows the current folder’s location at the bottom of the window.
- In Finder, go to View → Show Path Bar (if it’s not already visible).
- Select the file or folder.
- The path bar at the bottom shows the full hierarchy, e.g.,
Macintosh HD ▸ Users ▸ name ▸ Documents ▸ report.pdf. - Right-click the file name in the path bar and choose Copy Path as Text.
This copies the POSIX path (with slashes) to the clipboard. If you don’t see the option, make sure you right-click on the file name itself, not on the folder above it.
Method 4: Drag and Drop into Terminal or Text Editor
This is a handy trick for Terminal users.
- Open Terminal (or any text editor that accepts drag-and-drop).
- Drag the file from Finder into the Terminal window.
- The full path appears automatically, with spaces escaped if needed (e.g.,
/Users/name/My\ File.txt).
In a text editor like TextEdit, dragging a file inserts its path as plain text (no escaping). This method is great when you’re already working in Terminal and need to reference a file.
Common Pitfalls and Misconceptions
Several things confuse users when copying paths.
- Spaces in file names: When you copy a path with spaces, it’s fine for Finder, but in Terminal you need to escape spaces with a backslash (
\) or quote the whole path. The drag-and-drop method does this automatically. - Tilde (~) vs. full path: Some apps show
~/Documentsinstead of/Users/name/Documents. The tilde is a shortcut for your home folder. The copy methods above give the full path, which is more portable. - iCloud Drive paths: Files in iCloud Drive are stored locally in
~/Library/Mobile Documents/com~apple~CloudDocs/. If you copy a path for a file that’s not downloaded locally, the path may not work until the file is downloaded. - Copying from the title bar: Some users think the folder name in the Finder title bar is the full path. It’s not – it’s just the current folder’s name. To see the full path, right-click the title bar (or use the path bar).
How to Copy a Path Without Finder
If you’re already in Terminal, you can use the pwd command to print the current working directory, then copy it manually. Or use echo $PWD. To copy a file’s path directly, you can use realpath filename (if installed) or simply readlink -f filename. But for most users, Finder’s built-in methods are enough.
Frequently Asked Questions
How do I copy the path of a file on a Mac without using the keyboard?
Use the path bar: View → Show Path Bar, then right-click the file in the path bar and choose Copy Path as Text. Or use Get Info and copy the “Where” field.
Why does Command+Option+C not work on my Mac?
Make sure you have selected the file in Finder first. If you’re in a dialog (like Open/Save), the shortcut won’t work. Also, check if you have any third-party clipboard managers that might be intercepting the shortcut.
How do I copy a path in macOS Ventura or Sonoma?
The methods are the same. Command+Option+C works in all recent versions. The path bar and Get Info methods are also unchanged.
Can I copy multiple file paths at once?
Yes. Select multiple files in Finder, then press Command+Option+C. The clipboard will contain a newline-separated list of all the paths.
How do I copy the path of a folder (not a file)?
Exactly the same way. Select the folder in Finder and press Command+Option+C, or use the path bar.
What’s the difference between copying a path and copying a file?
Copying a path copies the text location (e.g., /Users/name/file.txt). Copying a file (Command+C) copies the actual file data so you can paste it elsewhere. They are different actions.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.