How to tell full path of file on Mac?
I have a text file opened up in TextEdit, and I can't seem to figure out the full path of the file.
Also, if I search for the file in spotlight, it doesn't seem to tell me the full path of the file either.
I'm clearly missing something here. How to tell the full path?
You can Command-Click
the icon and file name in a window's title bar to reveal the full path as a menu:
You almost never need this path: Due to the lack of an address bar in Finder, where would you paste it? You can just drag the file proxy (the icon) from a window's title bar into an Open… file dialog to select it e.g. in a different application.
If you really want the full path to a file in a copyable form, you can drag and drop the file or its proxy icon onto a Terminal window. From there, you can then copy and paste it.
Simple text editing fields (like text areas on web sites), or Text Edit's plain text view behave in a similar way: Just drag & drop the file onto them.
You can also use Automator to create a Service that copies a selected file or folder's path to the clipboard. Launch Automator, select Service, and that it receives selected files and folders in any application. Save, and name it e.g. Copy File or Folder path.
Just select a file or folder in Finder or any other program that works in a similar way and invoke your new service from the Application Menu » Services » Copy File or Folder path (it will only show up if you actually have files or folders selected). You can assign a keyboard shortcut in System Preferences » Keyboard » Keyboard Shortcuts » Services
A file's path is also displayed in its details dialog in the General category, from where it can be selected and copied:
A selected file's path is also displayed in the Finder's path bar, which you can enable from View » Show Path Bar. It's enabled by default for Spotlight results windows AFAIK.
From the Spotlight menu, you can press Command-I
to open the file's Get Info dialog, drag it to Terminal, drag it to a TextEdit plain text view or a similarly simple view, or drag it to an Open… file dialog.
From the Spotlight results window, you can open the Get Info dialog, drag the file to Terminal, to TextEdit, an Open… file dialog, or invoke the service. The full path is also displayed in the Path Bar.
You can show full paths in the Spotlight menu by holding command and option. Or in Alfred ⌘C copies the absolute paths of files.
I have assigned this script to ⌃⌘C:
try
tell application (path to frontmost application as text)
set the clipboard to (path of document 1) as text
end tell
on error
try
tell application "System Events" to tell (process 1 where frontmost is true)
value of attribute "AXDocument" of window 1
end tell
do shell script "ruby -rcgi -e 'print CGI.unescape ARGV[0][16..-1]' " & quoted form of result
set the clipboard to result
end try
end try
The first method didn't work with Preview, TextMate 2, Sublime Text, or iChm, and the second method didn't work with Acorn.
In most programs you can command+click (or apple+click, depending on your keyboard) on the file's name in the title bar of its window and you'll get its path arranged vertically in a dropdown list.
Or in Finder, for instance after a search, you can select the file and do command+I to bring up the file information window, which should have the full path somewhere.