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

Command grouping

Commands may also be grouped so that all of the output is either piped to another command or redirected to a file:

    $ ( ls; pwd; date ) > outputfile

The output of each of the commands is sent to the file, outputfile. The spaces inside the parentheses are necessary:

    $ ( w ; date ) > whoandwhen

The output of the w command and date will be redirected to the whoandwhen file:

    $ (echo "***x.c***";cat x.c) > log.txt

Output:

This redirects the content of x.c with a heading ***x.c*** to the file out:

    $ (pwd; ls; date) > log.txt

Output:

This redirects the output of commands pwd, ls, and date in the log.txt file.

主站蜘蛛池模板: 茶陵县| 清流县| 无锡市| 宝鸡市| 进贤县| 汶川县| 韶关市| 龙南县| 宣城市| 五大连池市| 揭阳市| 广汉市| 屯昌县| 岳西县| 徐水县| 凭祥市| 高安市| 延庆县| 博白县| 光泽县| 台南县| 毕节市| 武平县| 万山特区| 景德镇市| 洛浦县| 仙游县| 襄城县| 墨竹工卡县| 叙永县| 佛冈县| 陆良县| 巴楚县| 宣武区| 瑞昌市| 舟山市| 娄底市| 嘉义县| 武功县| 共和县| 鄂托克旗|