Search code examples
terminalgnome-terminal

How to execute multiple commands after opening a new terminal tab


I need to open a new terminal tab and execute multiple commands on it, how can I do it. I have already tried the following,

gnome-terminal --tab -t "X" -e "cd ~/Desktop/terminal_test;mkdir test"

Here I need to cd into a new directory and create a new folder.


Solution

  • Try this:

    gnome-terminal -x bash -c "cmd1; cmd2; …cmdN; exec bash"