Use iTerm2 and Mac OSX 10.8.3 to open tabbed shells to specific systems

I'm still fairly new to the MAC and I have been seeking a way to script or use the GUI to accomplish the following.

Open Iterm to a group of hosts and ssh to each of them in a tabbed view.

In the gui I can do

New Window -->> Profiles -->> open Profile I created

This gives me a single window that will execute an ssh command to a single host.

Any help or direction greatly appreciated.

I have read through the similar questions before posting as none of them seemed to solve my issue.


Uh-huh. If I got things right, you can do that just right with the iTerm2.

First, create the needed profiles in Preferences - Profiles. You can use a "Send text at start" box to send whatever command you need when you open that profile. For example, let's use ssh [email protected]:

iTerm2 Preferences - Profiles

Second, you have to create a desired arrangement. For that, just create the tabs or splits you need with the needed profile. You can add new tabs with Profiles - Open (Cmd+O) in the menubar. Just select the profile and press the button (New Tab / Split):

Profiles - Open...

You also can change profile of the existing tabs/splits by right-clicking the content of that terminal and choosing Edit Session....

When you have the desired window/tab/split layout, save it via Window - Save Window Arrangement.

And now, you finally can use Window - Restore Window Arrangement to load everything automatically.

iTerm2 is a very powerful tool, you can tweak it for your needs, assign some hotkeys to make actions faster and whatever.