Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run the same linux command in more than one tab/shell simultaneously? [closed]

Is there any tool/command in Linux that I can use to run a command in more than one tab simultaneously? I want to run the same command: ./myprog argument1 argument2 simultaneously in more than one shells (I want to increase this so as to put my code under stress later on) to check if the mutexes are working fine in a threaded program.

I am kind of looking for something like what wall does. I can think of using tty's, but that just seems like a lot of pain if I have to scale this to many more shells.

like image 903
Arpith Avatar asked Jan 27 '26 23:01

Arpith


1 Answers

Why not do something like

for i in {1..100}
do
    ./myprog argument1 argument2 &
done

This is in case the shell is bash. You can look into other looping constructs in case of other shells.

like image 169
Subhasis Das Avatar answered Jan 29 '26 11:01

Subhasis Das