2016-04-28 62 views
2

我想使用三通追加到多個文件,但是,我不需要它打印到我的外殼,只是文件。輸出到/ dev/null的偉大工程,爲命令仍然附加到文件,不打印到shell:正確的方式不打印到外殼與發球命令

echo test | tee -a file1 file2 file3 &>/dev/null 

我只是想知道這是否是做了正確的方法,如tee --help似乎沒有有一個參數不打印到外殼:

-a, --append    append to the given FILEs, do not overwrite 
    -i, --ignore-interrupts ignore interrupt signals 
    -p      diagnose errors writing to non pipes 
     --output-error[=MODE] set behavior on write error. See MODE below 
     --help  display this help and exit 
     --version output version information and exit 

我敢肯定這是做正確的方式,我想我只是想一些確認。

+0

只使用輸出重新方向'>> filename'在該行的末尾 – Ankanna

回答

3

好吧好吧然後...

... | tee -a file1 file2 >> file3