You can use multiple commands in Linux using screen command. Here I using the window number, instead of the window name:
- create session
screen -S SessionName -t 0 -A -d -m
- create second window
screen -S SessionName -X screen -t 1
- send command to first window
screen -S SessionName -p 0 -X stuff $'echo WinName0\necho cmd1\necho cmd2\n'
- send command to second window
screen -S SessionName -p 1 -X stuff $'echo WinName0\necho cmd1\necho cmd2\n'
- now check if the command has been runned on the first window
screen -R SessionName -p 0
- now check if the command has been runned on the second window
screen -R SessionName -p 1
Tested with screen (CENTOS 7.x x64).
YouTube channel: https://www.youtube.com/@trainbrain007