How to run multiple Unix commands in one time?

Viewed 86625

I'm still new to Unix. Is it possible to run multiple commands of Unix in one time? Such as write all those commands that I want to run in a file, then after I call that file, it will run all the commands inside that file? or is there any way(or better) which i do not know?

Thanks for giving all the comments and suggestions, I will appreciate it.

8 Answers

To have the commands actually run at the same time you can use the job ability of zsh

$ zsh -c "[command1] [command1 arguments] & ; [command2] [command2 arguments]"

Or if you are running zsh as your current shell:

$ ping google.com & ; ping 127.0.0.1

The ; is a token that lets you put another command on the same line that is run directly after the first command.

The & is a token placed after a command to run it in the background.

Related