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

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.

主站蜘蛛池模板: 五莲县| 内丘县| 湖州市| 河北区| 塔河县| 濉溪县| 田林县| 定安县| 龙陵县| 健康| 台州市| 青州市| 东乡县| 郴州市| 广水市| 深圳市| 南岸区| 榕江县| 兴文县| 周宁县| 许昌县| 栾川县| 高要市| 阜南县| 开化县| 肇东市| 五台县| 黔南| 金阳县| 抚松县| 新泰市| 陇西县| 竹山县| 温泉县| 斗六市| 上饶市| 那曲县| 抚州市| 鹿邑县| 兴业县| 安庆市|