What's a quick way of copying the path to the directory that's currently open in Finder?
Copying that path is very easy in Linux and Windows file managers - you just need to copy it from the address bar. I don't see a corresponding option in Finder.
What's a quick way of copying the path to the directory that's currently open in Finder?
Copying that path is very easy in Linux and Windows file managers - you just need to copy it from the address bar. I don't see a corresponding option in Finder.
Option+Command+C
Will copy the path for selected folder or file to the clipboard. Tried on El Capitan.
Being a reluctant Apple user (my employer only supports Macs, but I've always used Windows) I'm staggered at how complex some tasks are, such as this one. Windows has the location bar (like a browser) and the location can be copied and pasted from there. It's clear where you are, and simple to 'jump' somewhere else. No 3rd party software required - as seems popular here!
– cyberspy Mar 08 '23 at 09:31Next to the name of the folder in the Finder is an icon depicting that folder. This icon can be dragged to anywhere you need to accept a path - dragging to the Terminal or TextEdit in plain text mode will drop the path as text in the window or document. However, this does not work with all destinations - copying to a rich-text TextEdit document, for example, copies a link to the folder and not the path.
There are some third-party apps, some free, some paid, that add this functionality. You can also create a service with Automator (or AppleScript) to do it, but a simple and free method that I like, especially if you like to use the terminal anyway, is to invoke DTerm on the Finder window and run:
pwd | pbcopy
That will copy the current path to the Mac OS X clipboard.
pwd | tr -d '\n' | pbcopy.
– Eric Leschinski
Dec 17 '19 at 15:15
~/.zshrc) so that pwdc will copy the current terminal directory to clipboard, like so: alias pwdc='pwd | pbcopy'
– Dylan Hogg
Jan 02 '22 at 01:53
You can use Automator to do this with a single keyboard shortcut that you can use from any app, and without installing 3rd party software.
This Automator Service will copy the path of the Finder's front window, rather than the path of a selected file or folder, so it won't affect what windows are open or what items are selected. The path that is copied is simply text, so it can be pasted anywhere that you can paste text.
no input (or "files or folders" to have it appear from a right click) and leave it set to any application (unless you only want it to work from a specific app, like the Finder).Replace (* Your script goes here *) with:
try
tell application "Finder" to set the clipboard to POSIX path of (target of window 1 as alias)
on error
beep
end try
Save the Automator Service with whatever name you'd like it to have in the Services menu.
This Automator Service will now be in your Services menu.
Note: This doesn't escape spaces, so if your path has spaces, you may need to quote it. For example, in Terminal, the path would need to be quoted, but in Finder's "Go to Folder" command, it would not. If you want it to copy as quoted, you can change POSIX path to quoted form of POSIX path.

You can add a keyboard shortcut for the service by going to System Preferences > Keyboard > Keyboard Shortcuts, then click on "Services" in the left pane, then scroll down to the "General" section in the right pane until you find your service.

Command + I, then copy information under Where:

If you need the path in Terminal/iTerm, you can just select the file/folder in Finder, copy it (Command+C), switch to the Terminal and paste it (Command+V).
You can also drag and drop the file/folder to the Terminal/iTerm.
If you use Alfred, you can select the items, press ⌥⌘\, and select Copy path to Clipboard.
You could also assign a shortcut to a script like this:
tell application "Finder"
set the clipboard to POSIX path of (insertion location as alias)
end
This would copy the paths of all selected items:
set l to {}
tell application "Finder" to repeat with f in (get selection)
set end of l to POSIX path of (f as alias)
end repeat
set text item delimiters to linefeed
set the clipboard to (l as text)
There's a bug on 10.7 and 10.8 where the selection, insertion location, and target properties refer to the second frontmost window after opening a new window. It affects both scripts and Alfred, but not Automator services. As a workaround, you could move focus to another application and back before getting the selection:
activate application "SystemUIServer"
activate application "Finder"
input and by assigning it to an Automator-based Service that receives files or folders in Finder.app. To work around the bug when obtaining Finder's insertion location (1st script), you can apply the following, uuugly, but effective hack (works on 10.8.2): hide Finder, then unhide it again after a short delay - this will cause Finder to report the correct selection/insertion location afterward; obvious downside: flashing.
– mklement0
Oct 29 '12 at 13:05
The MacYourself tip Copy file or folder path to the clipboard in Mac OS X Lion works for me on 10.7.4. Basically it leads you through the steps of creating an Automator service that can be used to copy the full path of files and folders from the Finder. You then use it by assigning a custom hotkey or use the right-click menu to copy the path to the clipboard when a file or folder is selected.

If it helps, you can also type the following command into the Terminal to get the Finder to display the full path to the current folder in its titlebar:
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
Use the following to turn it off again:
defaults write com.apple.finder _FXShowPosixPathInTitle -bool NO
~/Library/Services I think describing a method to download the file then copy it here (as ~/Library is hidden by default on Lion), then follow half the MacYourself instructions to add the shortcut would actually be more complicated. The instructions provided by MacYourself are pretty straightforward to follow.
– binarybob
Aug 28 '12 at 06:41
Although this doesn't answer your question directly, I have a more efficient method of obtaining the file's path (presumably for it to be pasted into terminal or a text file, for example). Simply drag-and-dropping the file into a text field will automatically insert the file's path.
Back a few years ago, I would always have the pos utility written by Gary Kerbaugh to improve finder / terminal interaction.
cdf would cd to the path of the frontmost Finder windowfdc would open a Finder window at the current shell pathposd would just dump the pathThis coupled with pbcopy and pbpaste should fit the bill for getting arbitrary paths to text format and then into your clipboard.
I believe homebrew has adopted part but not all of this package so I'm not sure if you can find a workable version of all the above, but it was magic when I first started using it. Now I just use Launchbar to push files around without caring so much about recording a specific folder.
posd | pbcopy sounds like it would work. The rest seems nice to have (though won't open . work instead of fdc?)
– Kyle Cronin
Apr 02 '12 at 04:35
open . though - it's elegant.
– bmike
Apr 02 '12 at 05:17
The easiest way I know to get the path to a file or folder is to Get Info on the folder or file (select it, right-click and pick Get Info), and then in the middle "General" section, you can select and copy (command + C) the path.

As for your other question, clicking on column headers in list view in the Finder does allow you to sort ascending or descending.
I do not understand the last question you ask -- again, I'd say go to the file itself, right-click and do as I described above to get the path.
Since Yosemite now has Windows-like dropdowns in Info window and this is the top Google result, here's what I came up with:
Info window, the Comments and Preview sections will be expanded by defaultAs of macOS Catalina:
Like @Kokizzu said, to get the "Copy as Pathname", open your context menu (right-click or two-finger click). Once it is open, hold down the alt/option key to get that option to appear.
On OS X, many things can be accomplished by dragging & dropping. Apple thinks you don't need to be able to access the file path conveniently because everything can be accomplished by drag & drop. I'm not completely of the same mind, but usually I can do what I want.
This is how common actions are performed on OS X where you would need a path in Windows or Linux.
To just find out where you are in Finder, right-click (or Command ⌘-click) the folder name in the title area.
In a file selection dialog, to navigate to an opened Finder location, drag the folder or any file from that folder onto the selection dialog. This will not move the file or folder like it does in Windows, but set the path of the File dialog instead. (You can also drag a the document proxy icon (from the title bar of most apps) or ⌘-drag items out of the Dock to do this.)
To get the path of a file in Terminal or another text-only Application, drag the file on the Terminal window.
What is not (easily) possible:
Copy Path Finder Button is by far the easiest method I've found to accomplish this. It's so simple – download it, put in your Apps folder, then drag to your finder's toolbar, done.
To copy the active path in Finder, simply control-click the folder or file to bring up the contextual menu. Next, select copy the_folder/file_you_want. Following that, you can paste the path to a terminal window.
I just made a quick Automator Action. The Get first Finder Window Path action will to get the front most Finder windows Posix Path. It a beta, but is working ok. 10.8 only It will return the Posix path of the front most open Finder window.
1, Open the zip and install it by double clicking on the action.
It will go into the Utilities Actions name 'Get first Finder Window Path'
2, drag it as normal to workflow area and add for example the 'Copy to Clipboard' action below it

The Service selected can be file or folder if you save it as a'Service' this will enable you to then also use the contextual menu when clicking on any file or folder. doing so will run the actions and only return the Same window result. Not the selected file or folder. Alternatively set it to 'none.
You can save it as a service or like me save it as an Application and then drag the app into the finder windows Toolbar.
Where you just have to click it.

/Volumes/whatever/path/to/frontmost/window/viewor something else? Basically, what is the next step you are going to perform with the path once you have it? – bmike Apr 02 '12 at 04:09