how to redirect a output of a command to two files

前端 未结 6 1643
孤独总比滥情好
孤独总比滥情好 2020-12-06 09:47

i need to redirect a output of a command to two files say file1 and file2 file1 is a new file and file2 is already existing file where i need to append the output i have tri

6条回答
  •  天涯浪人
    2020-12-06 10:24

    In PowerShell use tee-object (or its tee alias)

    command | tee first-file | out-file second-file
    

    Can also tee to a variable (e.g. for further processing).

提交回复
热议问题