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

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.

主站蜘蛛池模板: 盘锦市| 通许县| 安多县| 家居| 通城县| 莱西市| 太湖县| 保德县| 海原县| 六盘水市| 三亚市| 乐安县| 屏边| 康定县| 晋城| 惠来县| 巴楚县| 上栗县| 朝阳市| 常宁市| 甘谷县| 开封县| 介休市| 高邑县| 西丰县| 平潭县| 沅陵县| 乌什县| 沙河市| 龙江县| 宣化县| 巩留县| 清镇市| 来宾市| 安仁县| 泗水县| 明星| 溆浦县| 龙江县| 祥云县| 罗田县|