本文介绍了使用“>"、“&>"、“>&"重定向输出有什么区别?和“2"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 >
、&>
、>&
和 2& 重定向输出有什么区别?>
?
推荐答案
>
将 stdout 重定向到一个文件2>&
将文件句柄2"(几乎总是 stderr)重定向到其他文件句柄(通常写成2>&1
,它将 stderr 重定向到与 stdout 相同的位置).&>
和>&
将 stdout 和 stderr 重定向到一个文件.它通常写为&>file
(或>&file
).它在功能上与>file 2>&1
相同.2>
将输出到文件句柄 2(通常是 stderr)重定向到一个文件.>
redirects stdout to a file2>&
redirects file handle "2" (almost always stderr) to some other file handle (it's generally written as2>&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"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!