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

  • 相关阅读:
    Nginx Mac笔记
    当一个女人门外有一个流氓时,她该做什么
    图片圆角并居中显示解决方案
    caffe源码学习之Proto数据格式【1】
    google gflag使用方法举例
    降维之pca算法
    聚类之dbscan算法
    ubuntu 使用sudo apt-get update 出现 被配置多次导致无法升级错误解决方法
    关于python使用threadpool中的函数单个参数和多个参数用法举例
    python科学计算之numpy
  • 原文地址:https://www.cnblogs.com/xuanbjut/p/12912604.html
Copyright © 2011-2022 走看看