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

千万里不及你
TA贡献1784条经验 获得超9个赞
2>
foo > stdout.txt 2> stderr.txt
foo > allout.txt 2>&1

函数式编程
TA贡献1807条经验 获得超9个赞
>
, >>
|
command &> /some/file
*command* > file 2>&1
*command* 2> /dev/null
- 3 回答
- 0 关注
- 1396 浏览
添加回答
举报
0/150
提交
取消