How to redirect and append both stdout and stderr to a file with Bash?

前端 未结 7 1183
春和景丽
春和景丽 2020-11-22 01:16

To redirect stdout to a truncated file in Bash, I know to use:

cmd > file.txt

To redirect stdout in Bash, appending to

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 01:41

    In Bash 4 (as well as ZSH 4.3.11):

    cmd &>>outfile
    

    just out of box

提交回复
热议问题