How to copy a file path on Mac
Note My gets a path onto the clipboard from the Finder or from the file you already have open, without you retyping it. Here is every route to one, and what each verb actually copies.
You are halfway through typing a command, or writing a ticket, and you need the exact path to a file. Reading it off the Finder's title bar and retyping it is how typos get into commands. What you want is the path itself, on the clipboard, spelled correctly, without opening anything you do not need to open.
Note My puts the copy verbs in two places: the Finder's right-click menu, for a file you are looking at but have not opened, and the File menu, for the file you are already editing. They overlap deliberately, and they copy slightly different things, so it is worth knowing which one you want.
None of this leaves your Mac. Nothing is uploaded, there is no account to create, and the file you copy from stays exactly where it is. Whichever route you take, the path or the text lands on your clipboard and nowhere else.
From the Finder: the Note My menu
Right-click a file in the Finder and a branded Note My ▸ submenu appears alongside the system's own items. Its contents change with what you have selected, which is why the menu can look different from one right-click to the next.
| Item | When it appears |
|---|---|
| Open · Open in Background | Any selection |
| Compare the 2 Files | Only when exactly two files are selected |
| Concatenate & Open | Only with more than one file selected |
| New File Beside This… ▸ | Any selection |
| Open Containing Folder · Open in Terminal Here | Any selection |
| Copy Path · Copy Relative Path | Any selection |
| Copy Contents · Copy as Markdown Code Block · Copy for AI (path + fenced) | Only with a single file selected |
Copy Path is the one most people are after: the file's full path, as text, ready to paste into a shell, a config file or a message. Copy Relative Path is there for when the full path is more than the person reading it needs — a shorter form, for pasting somewhere the surrounding folder is already understood.
The three single-file verbs sit at the bottom because they copy the file's contents rather than its location. Copy Contents is the plain one: the file's text on the clipboard, nothing added. Copy as Markdown Code Block wraps it in a fence. Copy for AI combines the two ideas — the path, then the contents fenced — which is the shape a chat window wants when you are asking an AI assistant about one specific file.
The menu follows your selection, so what it offers always fits what you have picked. One file gives you the three content verbs. Exactly two gives you Compare the 2 Files. More than one gives you Concatenate & Open, which joins them into a single document. Copy Path and Copy Relative Path are offered whatever is selected.
Folders, and the Finder's sidebar
Right-clicking a folder, the background of a Finder window, or an item in the sidebar gives you a menu built around the location itself rather than a file inside it. It offers Open This Folder, New File Here… ▸, New File from Clipboard, Open in Terminal Here, and Copy Folder Path.
That last one is the answer to "how do I copy a folder path on a Mac" without selecting anything inside it. It works from the sidebar too, which is the quickest route to the path of a folder you have pinned there.
Copy the path of the file you are editing
If the file is already open in a tab, you do not need the Finder at all. Thirteen file actions sit in the File menu below Save As, and three of them are copy verbs.
-
Give the tab a home on disk
A path exists once the file does. Save the tab with ⇧⌘S, choose where it should live, and it carries a path from that moment on. For a file that is already on disk, the Finder route works straight away.
-
Press ⌥⇧⌘C for Copy Path
That is File ▸ Copy Path, the verb you will reach for most, so it carries a shortcut of its own. The full path of the active tab's file goes to the clipboard, ready to paste.
-
Use the menu for the narrower two
File ▸ Copy File Name copies just the name, with no folders in front of it — useful in a commit message or a ticket title. File ▸ Copy Containing Folder Path copies the folder the file sits in, which is what you usually want before a
cd. Both sit alongside Copy Path, one trip to the File menu away.
The tab's own right-click menu
Right-clicking a tab in the tab bar gives you the same file actions again, plus three of its own: Open in Terminal, Save and Open in Terminal, and Copy to Clipboard. If you keep several files open and switch between them, this is often faster than going to the menu bar: the menu is anchored to the tab you clicked, and its header names that file and shows its icon and size, so you can see what you are about to act on. Right-clicking a tab that is not already selected selects it first.
If you want the whole document's text and want to be certain of what you are getting, ⌘A then ⌘C is unambiguous and works everywhere.
Copying a file's contents and pasting them into a document is a plain-text operation in both directions. Paste never brings styling with it, so fonts, colours and links from wherever the text came from are dropped and you are left with the characters alone. Very large pastes are looked after by our large-file engine, so the window stays usable and you keep control of what is happening: a paste long enough to take a moment puts a progress sheet on screen with a cancel button, so a paste you did not mean to start is never something you have to sit through.
Going the other direction: path to file
The reverse problem — you have the file open and want to see it in the Finder — has two answers.
⇧⌘R is File ▸ Reveal in Finder: a Finder window opens with the file selected. File ▸ Open Containing Folder opens the folder instead, without singling the file out.
There is also a quieter route. The path shown in the toolbar's identity capsule, beside the app's name, is a live link. Point at it and you get the full path as a tooltip, which is the fastest way to answer "where is this file, actually" without copying anything. Click it and the Finder opens with the file selected. A document you are still drafting carries its name on its tab, and the moment you save it the path takes its place in the capsule. While you are comparing two files, both paths are shown.
What saving a new tab switches on
Saving is the moment a draft becomes a file, and a whole group of the File menu comes to life with it. Copy Path, Copy Containing Folder Path, Reveal in Finder, Reload from Disk and the rest of that group all act on something the Finder can show you, so they wait for you to say where the file belongs and then take their cue from it.
Until you get there, your typing in a brand-new tab is looked after by our auto-recovery safety net, so a draft you have not named yet is not something you can lose by accident. When you are ready, ⇧⌘S lets you pick the folder, and from that press onwards the whole group works on the tab in front of you: ⌥⇧⌘C hands you its path, ⇧⌘R shows it to you in the Finder, and the toolbar capsule names it in full. Nothing about your text changes in the process — the file simply gains an address the rest of your Mac can use.
Troubleshooting
Adding the Note My submenu to the Finder's right-click menu
The Finder extension has to be switched on. It is offered during onboarding, and you can turn it on at any time in System Settings, under the extensions list. macOS keeps that switch on your side of the fence, which is where a decision about what appears in your own Finder belongs. Turn it on once and the submenu is waiting in every Finder window from then on.
Getting Copy Contents to appear
Select exactly one file. Copy Contents, Copy as Markdown Code Block and Copy for AI each act on one file at a time, so a single selection is what brings all three into the menu together. Copy Path and Copy Relative Path are offered for any selection at all, so the two commands people reach for most are never more than a right-click away.
Getting Copy Path working on a brand-new tab
The active tab has never been saved. Save it with ⇧⌘S, or switch to a tab that already has a file behind it, and the command comes straight back. The Finder route works either way: it acts on files on disk, so a right-click hands you a path whatever tab you happen to have in front of you.
The path breaks when I paste it into a shell
The clipboard receives the path as plain text, exactly as it is. If a folder in it contains spaces or other characters your shell treats specially, quote the path when you paste it. Getting the path verbatim is what makes that easy: a shell, a build script and a config file each want their quoting done slightly differently, and the raw path suits all three.
Copy Contents on a very large file feels slow
A big file takes longer to put on the clipboard than a small one, and that is expected. If where the text is going is another tab in the editor anyway, open the file first and copy from there instead: our large-file engine is built for documents that size, so the window stays responsive and you can scroll, select and copy without the app stalling on you. It all happens on your Mac, so nothing is waiting on a network. And if you only need part of the file, select that part and copy it: that is quicker than putting the whole thing on the clipboard and trimming it afterwards.
Picking the right verb for where it is going
Seven commands copy something about a file, and the one you want is decided by what sits at the other end of the paste. This is the short version, worth skimming once so the right verb comes to mind without thinking about it.
| Where you are pasting | What to reach for |
|---|---|
| A command in the terminal | Copy Path |
A cd in front of that command | Copy Containing Folder Path |
| A commit message or a ticket title | Copy File Name |
| A note where the surrounding folder is understood | Copy Relative Path |
| A chat where you are asking an AI about one file | Copy for AI (path + fenced) |
| A Markdown document or a review comment | Copy as Markdown Code Block |
| Another tab, or any plain-text field | Copy Contents |
Two more copy verbs are yours to switch on. Turn on the option under Settings ▸ Print & Export and Copy as HTML and Copy as RTF take their place in the Edit menu, ready to put the lines you have selected on the clipboard with their colouring intact — for the times the destination understands mark-up rather than plain characters. Leave the switch alone and the menus stay exactly as short as they were.
Every command on this page is a read. Nothing is moved, renamed or rewritten by copying, and a Finder copy of a file you also have open leaves the version on your screen exactly as you left it. That is what makes these safe to reach for in the middle of an edit, with a half-finished paragraph on screen and no urge to save first just in case.
Frequently asked questions
What is the keyboard shortcut for copying a file path on a Mac?
How do I copy a folder's path rather than a file's?
Two ways. Right-click the folder, the background of its window, or its entry in the Finder sidebar and choose Note My ▸ Copy Folder Path. Or, from a file you already have open, use File ▸ Copy Containing Folder Path.
Can I copy a file's whole text without opening it?
Yes. Select the single file in the Finder and choose Note My ▸ Copy Contents. Nothing opens; the text lands on the clipboard. If you want it wrapped in a fenced block, or wrapped with the path in front of it, the two commands beneath it do exactly that.
Why does the copied path look different from what the Finder shows in its title bar?
The Finder displays a friendly, localised version of a location. A copied path is the real one, which is what a shell, a build script or a colleague's terminal actually needs. That difference is the reason to copy rather than retype.
Does copying a path or a file's contents send anything anywhere?
Everything here happens on your Mac. Nothing is uploaded, there is no account, and nothing about the file or its contents is collected. The path or the text goes to the same system clipboard every other app on the Mac uses, and the file itself never leaves the machine.
Can I get the path of a file that is open without touching a menu?
Point at the path beside the app's name in the toolbar and the full path appears as a tooltip. That is the quickest way to read a path when reading is all you need, and clicking the same label opens the Finder with the file selected. When you want the text on the clipboard as well, ⌥⇧⌘C does it in one press.