Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am constantly opening up a pair of terminal windows which I like to have on separate tabs that I then use to SSH to the same pair of servers. I then set the titles of each tab to be that of the server I am connecting to. This is something I do manually every day and would love to be able to automate it.

So I tried the following:

gnome-terminal --tab
gnome-terminal --tab
gnome-terminal -t hello
gnome-terminal -t=hello
gnome-terminal -t="hello"
gnome-terminal --title="hello"
gnome-terminal --title=hello
gnome-terminal --title='hello'
gnome-terminal --tab --title='hello'

None of these options were able to open a new terminal window in a tab or with the title set to "hello". I haven't even tried to tackle the problem of ssh-ing to the servers yet. What am I doing wrong?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Try this:

gnome-terminal --tab -t "watch" -e "watch ps -ef" --tab -t "top" -e "top"

It seems that gnome-terminal ignores --tab if there is only one in the command line. You have to provide at least two --tab to have some effect.

The command to execute is given by -e or --command. I used watch and top in my example because they run indefinitely so the tabs will stay open. Once the command is done executing the tabs will close themselves. Read this answer for how to prevent the tabs from closing once the command is done executing.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.