Everywhere All articles Download

Command line and power tools

Copying a file path

Updated 2026-07-31 · 3 min read

Simple, frequently needed, and hidden behind a modifier key nobody discovers by accident.

Finder

Select the file and press ⌥⌘C. The full POSIX path goes to the clipboard:

/Users/sam/Documents/report.pdf

Or right-click, hold Option, and "Copy" becomes Copy as Pathname.

Drag into the Terminal

Dragging any file into a Terminal window pastes its path, already escaped for spaces. This is the fastest method when you are already at a prompt.

Get Info

⌘I, then the Where field. Selectable and copyable, though it gives the parent folder rather than the full path to the file.

From the Terminal

pwd                                    # current directory
echo "$PWD/filename"                   # a file here
realpath filename                      # resolves symlinks (needs coreutils)

To put it straight on the clipboard:

pwd | pbcopy

The escaping problem

A path with spaces breaks in the shell:

/Users/sam/My Project/report.pdf        # fails
/Users/sam/My\ Project/report.pdf       # works
"/Users/sam/My Project/report.pdf"      # also works

⌥⌘C copies the unescaped form, so pasting into a Terminal usually needs quoting. Dragging does the escaping for you, which is why it remains the practical method for shell work — and why a search tool that offers a shell-escaped copy saves a small irritation many times a day.

Common questions

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

⌥⌘C in Finder copies the full POSIX path.

Why does my pasted path break in Terminal?

Spaces need escaping or quoting. Dragging the file into Terminal escapes automatically.

Find any file before you finish typing

Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.

Download for Mac

Related

© 2026 Caretopia Network Private Limited Everywhere for Mac Articles Privacy Support