Home > Mobile >  How to execute multiple commands at the same time in Linux
How to execute multiple commands at the same time in Linux

Time:04-19

I was wondering how to execute all the commands present in a text file at the same time in Linux. Brief background- I have created a text file with content as below,

 nohup execute_command1
 nohup execute_command2
 .
 .
 .
 nohup execute_command30

And now I want to execute all the commands present in the text file at the same time in Linux server. How do I do that?

CodePudding user response:

Put & at the end of each line.

CodePudding user response:

cat text-file-with-commands | while read cmd; do $cmd & done
  • Related