Tell me more ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I was wondering if there was any was I could right click inside any instance of a "Finder" window such that I have an option that says "Open Terminal Here". It would be really helpful.

share|improve this question
4  
There are many answers to a similar question on Stack Overflow. – Rob Kennedy Apr 4 '11 at 3:22

11 Answers

up vote 33 down vote accepted

As of Mac OS X Lion 10.7, Terminal provides Services for opening a new terminal window or tab at the selected folder in Finder. They also work with absolute pathnames selected in text (in any application). You can enable these services with System Preferences > Keyboard > Keyboard Shortcuts > Services. Look for "New Terminal at Folder" and "New Terminal Tab at Folder". You can also assign them shortcut keys.

In addition, you can now drag folders (and pathnames) onto the Terminal application icon to open a new terminal window, or onto a tab bar in a terminal window to create a new tab in that window. If you drag onto a tab (rather than into the terminal view) it will execute a complete cd command to switch to that directory without any additional typing.

share|improve this answer

A different approach: DTerm, which gives you a floating command prompt at the top of the window. This works in many apps, not just Finder.

share|improve this answer

cdto seems like it is just what you need. It is a mini-application, designed to be put in the Finder's toolbar, when you run it it will open a terminal window and cd to the current directory in Finder.

share|improve this answer

The solution to your troubles is called Go2Shell and it does exactly what you're describing. You can find it on the App Store and best of all... it's totally free.

Go2Shell

share|improve this answer

You can do this with the service feature.

The following site contains an example of such a service: http://blog.leenarts.net/2009/09/03/open-service-here/

share|improve this answer

ShellHere

http://etresoft.org/shellhere.html — Etresoft and John Daniel

… right click inside any instance of a "Finder" window …

I don't know whether it can be reached through a contextual menu, but I keep ShellHere in the toolbar of Finder.

share|improve this answer

OnMyCommand

http://free.abracode.com/cmworkshop/on_my_command.html — version 2.3 (2011-01-16)

Screenshot etc. at http://www.wuala.com/grahamperrin/public/2011/07/31/d/?mode=gallery

Installed and used by me on Snow Leopard before upgrading to Lion. Too soon for me to say whether version 2.3 is compatible with Lion.

share|improve this answer

You can drag any file or folder from the finder onto a Terminal window to insert a string of said file or folder's absolute path.

This will work on any standard install (at least back until 10.4 Tiger [¿maybe earlier?]) without needing additional software our twiddling of preferences, either of which may later freak out your non-techy friend if it happens to be his/her Mac that you’re working on. This trick also works for any process that is running in the Terminal, e.g. emacs or vi (assuming you’ve got vi in the appropriate mode, or however it is that you people who use vi do).

share|improve this answer

  enter image description here

    OpenTerminal

 

share|improve this answer

I mostly use this function:

f() {
    cd "$(osascript -e 'tell app "Finder"
POSIX path of (insertion location as alias)
end')"
}

insertion location should be either the folder shown on the title bar of the frontmost Finder window or the desktop.

You could also assign a shortcut to an AppleScript like this. It opens the folder shown on the title bar, so it doesn't require selecting a folder first like the services added in Lion. That might be less convenient in list view though.

try
    tell application "Terminal"
        activate
        do script ""
        repeat while contents of selected tab of window 1 starts with linefeed
            delay 0.02 -- wait to get a prompt
        end repeat

        tell application "Finder" to set p to insertion location as alias
        -- this is after activating Terminal because of http://www.openradar.me/9406282

        do script with command "cd " & quoted form of POSIX path of p in window 1
    end tell
end try
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.