zoukankan      html  css  js  c++  java
  • shell脚本 在后台执行de 命令 >> 文件 2>&1 将标准输出与错误输出共同写入到文件中(追加到原有内容的后面)

    命令 >> 文件 2>&1

    命令 &>> 文件
    将标准输出与错误输出共同写入到文件中(追加到原有内容的后面)

    # ll >>aaa 2>&1
    root@test-W330-C30:~# cat aaa
    总用量 3248
    drwx------ 18 root root 4096 5月 18 19:35 ./
    drwxr-xr-x 36 root root 4096 5月 18 14:41 ../
    -rw-r--r-- 1 root root 49 5月 18 19:35 1
    drwxr-xr-x 3 root root 4096 3月 22 15:52 3d-haiguang-zhaoxim/
    -rw-r--r-- 1 root root 190 3月 22 15:58 3d-haiguang-zhaoxim.zip
    drwxr-xr-x 2 root root 4096 5月 4 20:12 aa/
    -rw-r--r-- 1 root root 0 5月 18 19:35 aaa
    -rw-r--r-- 1 root root 50 3月 31 10:44 .applet
    -rw------- 1 root root 23741 5月 18 13:12 .bash_history
    -rw-r--r-- 1 root root 3106 10月 23 2015 .bashrc
    drwxr-xr-x 2 root root 4096 5月 4 20:12 bb/
    drwx------ 6 root root 4096 3月 31 10:44 .cache/
    drwxr-xr-x 2 root root 4096 5月 4 20:12 cc/
    drwx------ 11 root root 4096 3月 20 19:46 .config/
    drwx------ 3 root root 4096 3月 20 19:43 .dbus/
    drwxr-xr-x 2 root root 4096 3月 31 10:44 Desktop/
    -rw-r--r-- 1 root root 15482 3月 20 19:46 .face
    drwx------ 3 root root 4096 3月 20 22:27 .gnupg/
    -rw-r--r-- 1 root root 132 3月 20 19:45 history
    -rw------- 1 root root 1388 3月 31 10:43 .ICEauthority
    -rw-r--r-- 1 root root 0 3月 31 10:43 .instance_kds.lock
    -rw-r--r-- 1 root root 3146783 4月 10 09:28 klbios-4.1.4-KL2003251-test-A1927-nologo.fd
    -rw------- 1 root root 36 5月 7 16:55 .lesshst
    drwx------ 3 root root 4096 3月 20 19:46 .local/
    drwx------ 4 root root 4096 3月 31 10:44 .mozilla/
    drwx------ 2 root root 4096 3月 20 19:46 .presage/
    -rw-r--r-- 1 root root 189 3月 13 22:09 .profile
    -rw-r--r-- 1 root root 81 3月 31 10:46 .recentAppLog
    -rw------- 1 root root 1024 3月 13 21:58 .rnd
    drwxr-xr-x 2 root root 4096 3月 20 19:46 .sogouinput/
    drwx------ 2 root root 4096 5月 15 12:35 .ssh/
    -rw------- 1 root root 12409 5月 18 13:09 .viminfo
    drwxr-xr-x 2 root root 4096 3月 31 10:43 .vnc/
    -rw------- 1 root root 967 5月 18 19:35 .Xauthority
    drwxr-xr-x 2 root root 4096 3月 20 19:46 桌面/
    root@test-W330-C30:~# ll >>aaa 2>&1

  • 相关阅读:
    文档重复检测软件 DuplicateDetector
    Afinal 0.2.1 发布 Android的快速开发框架
    CshBBrain 4.0 发布,高性能WebSocket服务器
    英特尔的 C++ 编译器发布 13.0 版本
    Perl 5.16.2 发布
    OpenBSD 5.2 发布
    Webconverger 15.1 发布,适合网吧的 Linux
    Spring Framework 3.2 RC1 发布
    Postgres 9.2 新特性之:范围类型 (Range Types)
    Expression Blend实例中文教程系列文章汇总
  • 原文地址:https://www.cnblogs.com/xuanbjut/p/12912604.html
Copyright © 2011-2022 走看看