将所有输出重定向到文件我知道在linux中,要将输出从屏幕重定向到文件,可以使用>或tee..但是,我不知道为什么部分输出仍然输出到屏幕,而不是写入文件。是否有将所有输出重定向到文件的方法?
3 回答

慕码人2483693
TA贡献1860条经验 获得超9个赞
2>
foo > stdout.txt 2> stderr.txt
foo > allout.txt 2>&1

慕哥6287543
TA贡献1831条经验 获得超10个赞
>
, >>
|
command &> /some/file
*command* > file 2>&1
*command* 2> /dev/null
- 3 回答
- 0 关注
- 396 浏览
添加回答
举报
0/150
提交
取消