brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: hold Option in the Finder's Control-click menu to copy a file's full path

Finder
~/tips/tip-finder-copy-as-pathname-option

Control-click the item

Copy the complete path of any file or folder to paste in Terminal or a config file.

When a config file, a script or a chat asks for the full path of a file, typing it is error-prone. Finder will copy it for you, but the menu item hides until you hold a key.

Control-click (or right-click) the file or folder, then hold Option. Copy changes into Copy as Pathname.

Control-click the item
hold Option
Copy "report.pdf" as Pathname

Paste it anywhere with Command-V and you get the full path, such as /Users/you/Documents/report.pdf. Apple mentions this in its Terminal guide as the quick way to copy a pathname.

There’s a second route via the path bar. Show it with View > Show Path Bar, then Control-click a folder in that bar and choose to copy it as pathname. Apple’s Get Info page describes that one.

I’d use it all the time with Terminal: cd , Command-V, Return. Or for a docker compose file that needs a full host path.

Watch the spaces. The copied path is plain text without quotes or backslashes, so a path like /Volumes/My Disk/file breaks in a shell command. Put quotes around it after pasting. And a path on an external drive is only valid while that drive is mounted under the same name.

Further reading: Specify files and folders in Terminal on Mac (Apple), Get file, folder, and disk information on Mac (Apple)

More Finder tips Option-Command-Y Quick Actions in the Finder preview pane rotate images and make PDFs Shift-Command-P show or hide the Preview pane Command-Up Arrow open the enclosing folder click the Trash in the Dock All Finder tips (37) All topics

Link