New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

help with termianal

Post Reply New Thread Subscribe

Thread Tools

Bika's Avatar
Member Since: Jan 30, 2010
Posts: 2
Bika is on a distinguished road

Bika is offline
Hello guys, im new at forum and im having a problem with terminals in general.

Ive been looking it a while and i hope to get the anwser here.

What I want is to find a way to open a new tab in a terminal and keep at the same directory of the current tab. ( Id like to use the classic terminal or terminator. dont like iTerm )

if anyone knows how to do it or a link that can guide me ill appreciate.

thanks in advanced!
QUOTE Thanks

Bika's Avatar
Member Since: Jan 30, 2010
Posts: 2
Bika is on a distinguished road

Bika is offline
could any one help me plz? anyone with same problem?
QUOTE Thanks

xstep's Avatar
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
I don't know of any automatic way to do that within Terminal.

In preferences you can run a script, but as far as I can recall recall, you can't peak at your other terminal sessions to know where they are.

I'd just do a 'pwd' in the current terminal window. Copy the result path. Use 'cd' and paste the copied path to the end of it, with a space between them.

You could likely make an elaborate method of copying the current path of the current window to a file and reading that upon login if it exists. That gets into changing the things like the cd command and beyond where I want to go.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks

cptkrf's Avatar
Member Since: Dec 08, 2009
Location: The same as Sheldon Cooper - East Texas
Posts: 453
cptkrf is a jewel in the roughcptkrf is a jewel in the rough
Mac Specs: iMac 2014 i5 5k 32gb 1tb fusion, second TB display, 2014 MBA

cptkrf is offline
Save the following script (and be sure to chmod it to 755). Run it and it will open a new tab(s) in the same folder.


# Make a new OS X Terminal tab with the current working directory.

if [ $# -ne 1 ]; then

/usr/bin/osascript <<EOF
activate application "Terminal"
tell application "System Events"
keystroke "t" using {command down}
end tell
tell application "Terminal"
repeat with win in windows
if get frontmost of win is true then
do script "cd $PATHDIR; clear" in (selected tab of win)
end if
end try
end repeat
end tell
QUOTE Thanks

Post Reply New Thread Subscribe

« /usr vs /Developer/usr | AppleScript Help Needed: Delete Watched TV Shows in iTunes »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

All times are GMT -4. The time now is 06:31 PM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?