Redirect stderr and stdout in Bash

后端 未结 15 920
日久生厌
日久生厌 2020-11-22 08:18

I want to redirect both stdout and stderr of a process to a single file. How do I do that in Bash?

15条回答
  •  故里飘歌
    2020-11-22 08:46

    do_something 2>&1 | tee -a some_file
    

    This is going to redirect stderr to stdout and stdout to some_file and print it to stdout.

提交回复
热议问题