Multiple times it happens when we have to run one single command on different Unix/Linux servers simultaneously. Running the same command on different servers at the same time not only saves time but also helps in comparing data between servers instantly.
In this tutorial, we will see “how to execute the same command on multiple Unix/Linux terminals” simultaneously.
We can run a single or multiple commands on different Unix boxes with the help of a small bash script. But, what if our SSH client gives us the capability to run the command on multiple Linux/Unix terminals?
So, one of the SSH clients or enhanced terminal for Windows that has this multi-execution facility is MobaXterm, which comes with many other features and functionality, which we will discuss in another article.
Steps to Execute the Command on Multiple Unix-Linux Terminals
Below are the simple steps to run the command on multiple Linux-Unix terminals.
1. Download MobaXterm and install it. The free version of MobaXterm can give you many features including multi-execute, multi-paste, etc.
2. Take SSH session of multiple servers in MobaXterm. For this tutorial, I have only taken 2 terminal. The terminal will be organized in tabbed form.
3. Once your different terminals are open, just click on “MultiExec” as shown in the below screenshot. Once you click that button, the screen will be split into 2 parts if you have 2 terminals opened and so on.
4. Now you can run your command on any one terminal and it will automatically run on all the terminals like the below screenshot.
5. Once you are done, you can click on “Exit Multi-execution mode” to exit this mode. At any time, if you don’t want to run the command on any particular or many terminals, you can use “Disable this terminal from MultiExec mode” option available at the bottom left of each terminal.
Do check the below video that will show you live how to run the command on multiple Unix Linux terminals.
I hope you like this tutorial and if you do, don’t forget to share this article with your peers. Do let me know what your thoughts are on this article through your comments, and also, let me know what other SSH programs you are using for Windows OS that allow you to run or execute the command on multiple Linux terminals.