azalea says

Mac OS X - open iTerm here

You can drag a folder from Finder onto the iTerm2 icon in the dock to open iTerm2 from the folder location.

How about saving some drag and opening iTerm2 by right click?

Here are the steps to create an Open iTerm Here context menu in Finder, like this:

Step 1

Open Automator

Step 2

File - New - Service

Set the top dropdown boxes to Service receives selected files or folders in

Double click or drag Run Shell Script from the left panel, and enter the following:

if [[ -d $1 ]]; then
    open -a iTerm $1
elif [[ -f $1 ]]; then
    parentdir="$(dirname "$1")"
    open -a iTerm $parentdir

Like this:

Step 3

File - Save - Save service as Open iTerm Here

It is stored in ~/Library/Services, in case it needs to be changed later.

That’s it! Now you can see the Open iTerm Here context menu option by right click on a file or folder in Finder. Note if it is a folder, the option is under Services.


Create Customize Shortcut in Mac’s Right Click Menu

Where are Services stored?

iTerm · Tweet Edit