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

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.

主站蜘蛛池模板: 麻城市| 奇台县| 宜州市| 龙口市| 台州市| 磐安县| 成都市| 德阳市| 萨迦县| 常宁市| 东乡县| 射阳县| 沭阳县| 象山县| 柯坪县| 永春县| 永春县| 晋州市| 元阳县| 蕉岭县| 饶河县| 万源市| 蚌埠市| 江川县| 扬州市| 邵东县| 玛纳斯县| 津市市| 阿克陶县| 衡山县| 汪清县| 儋州市| 治多县| 军事| 鄢陵县| 六盘水市| 滦南县| 浑源县| 吴桥县| 房山区| 中西区|