English 中文(简体)
调整中流和中流的产出方向?
原标题:Redirecting the output of both stdout and stderr?
  • 时间:2009-09-29 06:22:01
  •  标签:

I have one program, which writes its output to stderr and it also runs a executable internally which writes to stdout. I want to redirect the output of both to the same file using redirection operator something like "./a.out 2> output.txt", but this redirects the stderr, How to specify stdout also here.

最佳回答

海底:

./a.out > output.txt 2>&1
问题回答

或者

./a.out &> output.txt




相关问题
热门标签