BashTricks

programming

Run multiple commands in a single line

You can use the & operator to run multiple commands in a single line. For example:

command1 & command2 & command3

Run multiple servers in a single terminal

You can run multiple servers in a single terminal by combining the & operator with the wait command. For example:

node server1.js & node server2.js & wait

(This can sometimes be way better than using concurrently or npm-run-all, for example. Definitely removes the exposure to supply chain attacks.)