# Linux – Programmatically open tab in gnome-terminal, execute command, and have tab stay open

gnome-terminallinuxshell-script

I am trying to write a command that will launch a few terminal tabs, execute something in each tab, and have each tab stay open after the command in finished, so I can look at the output and type more commands in each tab

something like this:

gnome-terminal --tab -e "ls -a" --tab -e "ls"

but the problem with this is that the tabs close as soon as the "ls" commands finish. Does anyone know how to make the tabs stay open?

\$ gnome-terminal -e "bash -c \"echo foo; echo bar; exec bash\""