Open a Selected Finder Folder in a New Terminal Window

Dec 7, 2011 - 11 Comments

Open a New Terminal from the Selected Folder in Mac OS X

If you shuffle between the Terminal and the Mac OS X desktop often, you’ll get good use out of a Services feature which gives the ability to create a new Terminal window (or tab) from a selected folder within the Finder. You have to enable the Service inside System Prefs beforehand though:

  1. Go to System Preferences and click on “Keyboard”
  2. Select the “Keyboard Shortcuts” tab and click on “Services” from the left menu
  3. Scroll on the right until you see “New Terminal at Folder” and check the box next to it to enable the feature
  4. Close out of System Preferences

New Terminal at Folder setting in Mac OS X System Preferences

Now back at the desktop, right-click on any Finder folder to find the new “New Terminal at Folder” service at the bottom of the contextual menu.

New Terminal at Folder in Mac OS X

As expected, a new Terminal window will appear with the selected folder as the present working directory. Use the “New Terminal Tab at Folder” service instead if you regularly have many terminal windows open and like to keep things tidy.

Another approach would be to type “cd ” followed by dragging a folder into the terminal to print the full path, then hitting return to get the same result.

.

Related articles:

Posted by: AJ in Command Line, Mac OS, Tips & Tricks

11 Comments

» Comments RSS Feed

  1. whatever says:

    Hey everybody,

    had some issues with it myself.
    Assigning a shortcut did not work at the beginning. If I had selected a folder, then went to Finder > Services and then used the Shortcut it did work.
    Now I just set up the Shortcut “Ctrl + T” and it does work without problems.
    Really weird bug.

  2. Alex Worden says:

    I’ve tried to get this to work for years on various machines with no luck. I see the service. It’s clicked and it has a shortcut assigned. I’ve tried every combination of shortcut under the sun but no joy.

    If the shortcut isn’t already taken (and just about every one has been!), then the best I get is the ‘bonk’ sound and nothing happens.

  3. Nitin Madhok says:

    ​Try this tool: github.com/nmadhok/OpenInTerminal This is a really handy tool for programmers on Mac as it lets you open the folder directly in Terminal or iTerm2. You can select multiple folders to open them in multiple terminal windows. You can also select files to open the parent directory in Terminal. This application works with Finder as well as without Finder which is a plus!

  4. […] folder in Mac OS X with a click of a button. This is similar to the services option that can be added to the right-click contextual menu, but Go2Shell is faster due to resting in the Finder toolbar and being accessible with a single […]

  5. adam says:

    This works in Terminal with space without ” ?!?
    Just drop folder on icon is same way, with fix space with \ …

  6. Steve says:

    This is a great tip, thanks!

  7. qka says:

    I think this may be Lion only; I could not find it for Snow Leopard.

  8. a says:

    Same as Go2Shell?

  9. mark says:

    Lots of good finds in the Services menu

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site