zoukankan      html  css  js  c++  java
  • Redirect

       1>filename
          # Redirect stdout to file "filename."
       1>>filename
          # Redirect and append stdout to file "filename."
       2>filename
          # Redirect stderr to file "filename."
       2>>filename
          # Redirect and append stderr to file "filename."
       &>filename
          # Redirect both stdout and stderr to file "filename."
          # This operator is now functional, as of Bash 4, final release.

       M>N
         # "M" is a file descriptor, which defaults to 1, if not explicitly set.
         # "N" is a filename.
         # File descriptor "M" is redirect to file "N."
       M>&N
         # "M" is a file descriptor, which defaults to 1, if not set.
         # "N" is another file descriptor.

     2>&1
          # Redirects stderr to stdout.
          # Error messages get sent to same place as standard output.
            >>filename 2>&1
                bad_command >>filename 2>&1
                # Appends both stdout and stderr to the file "filename" ...
            2>&1 | [command(s)]
                bad_command 2>&1 | awk '{print $5}'   # found
                # Sends stderr through a pipe.
                # |& was added to Bash 4 as an abbreviation for 2>&.

       i>&j
          # Redirects file descriptor i to j.
          # All output of file pointed to by i gets sent to file pointed to by j.

       >&j
          # Redirects, by default, file descriptor 1 (stdout) to j.
          # All stdout gets sent to file pointed to by j.

  • 相关阅读:
    利用wget下载文件,并保存到指定目录
    tar命令详解
    Ubuntu 16.04中安装Chromium浏览器
    怎么打开unity tweak tool
    WPS for linux不能使用中文输入法
    Window7 驱动编程环境配置
    Windows内核 字符串基本操作
    Windows内核 语言选择注意点
    Windows内核 内存管理基本概念
    Windows内核 WDM驱动程序的基本结构和实例
  • 原文地址:https://www.cnblogs.com/greencolor/p/2072869.html
Copyright © 2011-2022 走看看