Running Gnome Terminal Tabs with custom title and command

tech kamar
1 min readDec 18, 2023

--

Often we come into situation where we need to run multiple gnome-terminal tabs. Also we might need to give them title to avoid confusion of which is which.

So here is the command to run bash scripts in a new tab with title for gnome-terminal.

First the syntax

gnome-terminal --tab --title "<Your Title>" -- bash -c "<Your custom command>; exec bash -i"

Now lets see with real world example. Let’s say you want to know system proces info using top command and that too in a new tab. So we can do it like this.

Lets save the contents given below to a file called topcommand.sh

gnome-terminal --tab --title "System Process Info" -- bash -c "top; exec bash -i"

now lets open a terminal and run it with the command

sh topcommand.sh

Now let’s see the output

You can see that it started the process in a new tab with title

Give a clap if you liked this small tutorial

--

--