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.
As of OS X Mountain Lion 10.8, Command-Dragging into a terminal will also execute a complete cd
command.
Note: The New Terminal at Folder service will become active when you select a folder in Finder. You cannot simply have the folder open and run the service "in place". Go back to the parent folder, select the relevant folder, then activate the service via the Services menu or context menu.
You can create a new service using automator (from the applications folder). At the top of the automator window, enter: Service receives 'no input' in 'any application'. Then, in the workflow, add 'Run applescript'. Make the applescript contain the following:
on run {input, parameters}
tell application "Terminal"
do script ""
activate
end tell
return input
end run
(You can add any command you like into the do script line between the " " (e.g. something useful to run when terminal first opens like uptime
if you like, or just leave it blank).
Save the service as 'Open Terminal' or whatever name you like. It should now appear in your services menu.
Then if you want to add a keyboard shortcut, you just need to go to System Preferences -> Keyboard -> Keyboard Shortcuts tab, select services in the left hand menu, and find your new service (its probably near the bottom). Just click in the space to the right of your service name, and assign it whatever keyboard shortcut you like, and hey presto! it should all work
Best Answer
Typing
open .
in Terminal will open the current working directory in a Finder window.