Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you open a new Mac OS X Terminal from Terminal and have it be in the same directory? (Snow Leopard) [closed]

Tags:

terminal

macos

I want to open a new terminal window from my current window. (like command+n opens a new terminal window that is in the same directory from the window I spawned it in). This has always annoyed me so today I want to solve it. Some bash script like

start /Applications/Utilities/Terminal.app -D CurrentDirectory

might work.

Also, my Lion machine does this automatically. I have Snow Leopard and I've searched through all the terminal preferences and the internet.

like image 902
David Witherspoon Avatar asked Jul 26 '12 18:07

David Witherspoon


People also ask

What Terminal does OSX use?

The Mac Terminal is a command line interface (CLI) for the macOS operating system (OS). Mac Terminal is typically used by network administrators and advanced technical users who want to initiate an action that is not supported by the operating system's graphical user interface (GUI).


2 Answers

Try:

open -a Terminal "`pwd`" 

This works for me (on Lion) but provided you can run that command, it should work on Snow Leopard, I believe.

like image 186
mlepage Avatar answered Sep 24 '22 17:09

mlepage


In your current Terminal window

pwd | pbcopy

Command-N to create a new window

cd "`pbpaste`"

The double quotes are necessary in case there is a space in your path, although I didn't test it.

The inner single quotes is the backtick character. It should work if you copy and paste the commands from my answer.

If you spend a lot of time in Terminal, consider using iTerm 2. It's got some great enhancements over Apple's Terminal.app.

like image 31
Mark Avatar answered Sep 25 '22 17:09

Mark