使用“>"、“&>"、“>&"重定向输出有什么区别?和“2"? [英] What's the difference of redirect an output using ">", "&>", ">&" and "2&>"?

查看:22
本文介绍了使用“>"、“&>"、“>&"重定向输出有什么区别?和“2"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 >&>>&2& 重定向输出有什么区别?>?

推荐答案

  • >stdout 重定向到一个文件
  • 2>& 将文件句柄2"(几乎总是 stderr)重定向到其他文件句柄(通常写成 2>&1,它将 stderr 重定向到与 stdout 相同的位置).
  • &>>&stdoutstderr 重定向到一个文件.它通常写为 &>file(或 >&file).它在功能上与 >file 2>&1 相同.
  • 2> 将输出到文件句柄 2(通常是 stderr)重定向到一个文件.
    • > redirects stdout to a file
    • 2>& redirects file handle "2" (almost always stderr) to some other file handle (it's generally written as 2>&1, which redirects stderr to the same place as stdout).
    • &> and >& redirect both stdout and stderr to a file. It's normally written as &>file (or >&file). It's functionally the same as >file 2>&1.
    • 2> redirects output to file handle 2 (usually stderr) to a file.
    • 这篇关于使用“>"、“&>"、“>&"重定向输出有什么区别?和“2"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆