官术网_书友最值得收藏!

Command1; command2

A command line can consist of multiple commands. Each command is separated by a semicolon, and the command line is terminated with a newline. The exit status is that of the last command in the chain of commands.

The first command is executed, and the second one is started as soon as the first one has finished:

    $ w; date

Output:

    $ w ; date > whoandwhen

Output from the date command will be redirected to the whoandwhen file.

In the preceding example, we can see that when we put multiple commands on the same line, but separated by the ; command, then those commands execute sequentially one by one:

    $ date; who am i
    Tue Mar 10 23:21:38 PDT 201
    student  pts/0        2015-03-10 23:12 (:0.0)  

In the preceding example, the date command is executed first and the who am I command will be executed next. Both the commands are typed on the same lines, separated by the ; command.

主站蜘蛛池模板: 阿克| 兰考县| 彭阳县| 赞皇县| 长兴县| 方山县| 府谷县| 肇源县| 九龙县| 镇江市| 新化县| 库车县| 永定县| 壤塘县| 唐海县| 中宁县| 隆化县| 长垣县| 措美县| 勃利县| 凭祥市| 聂拉木县| 察隅县| 深泽县| 冀州市| 新和县| 邻水| 巴南区| 增城市| 九江县| 德惠市| 呼图壁县| 民乐县| 阳朔县| 汶川县| 呼伦贝尔市| 濮阳县| 牟定县| 新沂市| 阿合奇县| 潞西市|