How to run multiple Unix commands in one time?

前端 未结 8 1236
一向
一向 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:39

    Sure. It's called a "shell script". In bash, put all the commands in a file with the suffix "sh". Then run this:

    chmod +x myfile.sh
    

    then type

    . ./myFile
    

    or

    source ./myfile
    

    or just

    ./myfile
    

提交回复
热议问题