How to redirect output to a file and stdout

后端 未结 10 1548
借酒劲吻你
借酒劲吻你 2020-11-22 08:11

In bash, calling foo would display any output from that command on the stdout.

Calling foo > output would redirect any output from that

10条回答
  •  眼角桃花
    2020-11-22 08:57

    You can primarily use Zoredache solution, but If you don't want to overwrite the output file you should write tee with -a option as follow :

    ls -lR / | tee -a output.file
    

提交回复
热议问题