Thursday, July 13, 2017

Bash Script to Run Multiple Commands in Different Tabs

Running Multiple Commands in Different Command Line Tabs


This small tutorial is directed at people that still have to do a lot of initial setup every time they reboot your Linux machine and are looking for some automation, with a simple bash script.
Creating a bash script to run multiple commands isn't really a hard task. I wrote some articles before about this here and here.
The tricky part was that I wanted some of those commands to run in different tabs so I can easily access the outputs for debugging purposes (like Docker containers, log monitoring, etc…).
I also didn’t want to go to the trouble of installing and configuring tools like tmux or tmuxifier (if you want something more advanced, definitely check them out!) for such a simple task like launching a few command line tabs. So, I decided to do some research and I found that the solution is rather simple if your Linux machine has gnome-terminal installed.