How to run multiple Unix commands in one time?

前端 未结 8 1260
一向
一向 2021-02-06 02:04

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,

8条回答
  •  名媛妹妹
    2021-02-06 02:42

    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.

提交回复
热议问题