To open a new terminal in the current Finder path in OS X, you can use the built-in service (See below on how to enable). But if you are already in a Terminal session, you need to leave the keyboard, mouse to Finder and drag and drop the path back. Here’s a trick that gets you to the frontmost Finder path without leaving the Terminal or keyboard.
Add the following to your
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
In a new Terminal (or reload the current), you now have the following commands available:
cdyou to the frontmost finder path
cfpwhich will copy the frontmost finder path onto the pasteboard
I usually leave my current working folder visible in Finder so I can see the files available while working in Terminal. To get back to that folder, a quick
cdf and I’m there.
OR: Enable the Service
To open a new terminal window at the current Finder path from Finder, you need the
New Terminal at Folder service enabled. Make sure it’s checked in System Preferences / Keyboard / Keyboard Shortcuts / Services under Files and Folders.
Once enabled, you can right click on any folder in Finder, choose Services / New Terminal at Folder to open a new Terminal at that location.