Copy the full path of a file on a Mac
· 6 min read
To copy a file’s full path on a Mac, select it in Finder, hold the Option key and choose “Copy as Pathname” from the Edit menu or the right-click menu, or press Option-Command-C. The path is now on the clipboard as plain text, for example /Users/sam/Documents/Invoices/march.pdf, ready to paste anywhere.
That covers most cases. The rest of this article is about the details that trip people up: the menu item that only appears with Option held, paths with spaces in them, files in iCloud Drive, and getting a path into Terminal without typing it.
The Finder command that hides until you hold Option
Finder has had a proper “copy path” command for years, but it is easy to miss because it is an alternate menu item.
- Select the file or folder in Finder.
- Right-click it (or Control-click).
- Hold the Option key. The item “Copy” changes to “Copy “march.pdf” as Pathname”.
- Click it.
The keyboard version is Option-Command-C, which works on whatever is selected. You can select several files and copy them all at once; each path lands on its own line, which is handy when you need to paste a list into a message or a script.
What you get is the absolute path, starting from the root of the drive with a forward slash. Spaces are left as spaces and nothing is escaped. That is what you want for a document, a chat message, a support ticket or a file dialog. It is not quite what you want for Terminal, which is covered below.
If you would rather see the path all the time than copy it now and then, show the full path in Finder walks through the path bar and the title bar options. The path bar has its own trick: right-click any folder in it and you can open that folder directly, which is often quicker than copying the path at all.
Getting a path into Terminal without typing it
Terminal treats a space as the end of an argument, so pasting /Users/sam/Client Work/notes.txt straight after a command breaks it into two words. There are three clean ways around that.
Drag the file into the Terminal window. Drop any file or folder from Finder onto a Terminal window and its path is typed at the cursor, with spaces and awkward characters already escaped with backslashes. Type the command first (cd, open, ls -l, with the trailing space), then drag. This is the fastest method and it has worked the same way for a very long time.
Wrap a copied path in quotes. If you used Copy as Pathname, type a quote, paste, and close the quote: cd "/Users/sam/Client Work". Single or double quotes both work for ordinary names.
Let the shell produce it. Inside Terminal, pwd prints the folder you are in, and realpath notes.txt prints the full path of a file in that folder. Pipe either into pbcopy to put it on the clipboard:
realpath notes.txt | pbcopy
If what you actually want is a Terminal window already sitting in the right folder, skip the path altogether: open Terminal at a folder on a Mac covers the Services menu item and the Finder toolbar options.
Paths that look wrong but are not
A few locations produce paths that surprise people the first time.
iCloud Drive. Files in iCloud Drive live under ~/Library/Mobile Documents/com~apple~CloudDocs/. Finder shows them as “iCloud Drive”, but the copied path is the real one on disk. It is correct, and apps that accept a path will open it.
Desktop and Documents with iCloud syncing on. These stay at /Users/yourname/Desktop and /Users/yourname/Documents even when iCloud is syncing them, so paths in scripts do not need to change.
External drives. Anything on a connected drive starts with /Volumes/ followed by the drive’s name. If you rename the drive, every path you copied earlier stops working, which is worth remembering before you paste paths into long-lived notes.
The tilde. ~ is shorthand for your home folder in Terminal. Copy as Pathname always gives the long form, which is what you want outside Terminal because most other apps do not expand the tilde.
When you copy paths all day
If copying a path is something you do once a week, the Finder command is all you need. If it is part of your work, for example handing files to scripts, pasting locations into tickets, or moving between Finder and Terminal constantly, two tools can cut out steps.
Ledge turns the MacBook notch into a shelf you can drag files onto from any folder or app. Its useful behavior here is the hand-off: drag an item from the shelf onto a terminal and it arrives as the path in text form; drag the same item onto Finder and the file itself moves; drop it into a text field and you get plain text. You gather files from several places once and each destination gets the form it can use, so you stop thinking about whether you need the file or its path. Auto-pasting a path into a terminal uses macOS Accessibility permission, which Ledge asks for only the first time you do it, never at launch. It works on Macs without a notch too, from the top center of the screen, and needs macOS 14 Sonoma or later.
If the slow part is finding the file before you can copy its path, Everywhere is a file search that catalogs the whole Mac by name and path. Select a result and Command-C copies its full path; Command-T opens Terminal at its folder. It searches names and paths, not the contents of files.
Neither is required. Everything in the first three sections works on a stock Mac.
A quick reference
- Copy the path of a selected item: Option-Command-C in Finder.
- Same thing by mouse: right-click, hold Option, “Copy as Pathname”.
- Insert an escaped path into Terminal: drag the file onto the Terminal window.
- Copy the current Terminal folder:
pwd | pbcopy. - Jump to a path you already have: in Finder, press Shift-Command-G, paste, press Return.
That last one is the reverse trip. Go to Folder accepts full paths, paths starting with ~, and Tab completion as you type, so a path pasted from a colleague’s message takes you straight to the file.
Questions
Why does Copy as Pathname not appear in my menu? It only shows while Option is held, and only when something is selected in a Finder window or on the desktop. If you are in an Open or Save dialog, drag the file into a Finder window first, or use Option-Command-C there.
Can I copy a path from the Get Info window? The “Where” line in Get Info shows the containing folder, not the file itself, and the formatting varies between macOS versions. Copy as Pathname is more reliable and includes the file name.
How do I copy a path for a Windows colleague? A Mac path uses forward slashes and has no drive letter, so it will not mean anything on their machine. Send the file or a shared folder link instead of the path. Collecting files from different folders before you send them covers bundling several files for someone else.
Does copying a path copy the file? No. It puts text on the clipboard. Pasting it into a Finder window does nothing useful; use Go to Folder to jump to the location instead.