A lot of times I find myself wanting to open another (Mac OS X) Terminal window in the same directory as my current one. This little shell script, which executes a little AppleScript, makes that trivial:
if [ $# -ne 1 ]; then
PATHDIR=`pwd`
else
PATHDIR=$1
fi
osascript -e "tell application \"Terminal\"" -e "do script \"cd $PATHDIR\"" -e "end tell"
Save this script somewhere in your $PATH with executable permissions. Now instead of hitting Command-N then typing “cd really/long/path/to/your/current/directory”, you can simply type the name of the script (I used “term”):
term
Chain them together to open multiple windows. The following would open three new windows with the same current directory:
term; term; term
It can also take an optional directory path argument to override the current directory:
term /System/Library/