2013-07-23 151 views
0

我已經嘗試使用tee>將終端輸出重定向到文件,如示例herequestion中的示例。它爲echo test | tee log.txtls -l | tee log.txt如何將ubuntu終端輸出重定向到一個文件?

,但它不能正常工作(不添加任何東西到log.txt中),當我運行像divine verify file.dve | tee log.txt 神聖的地方是一個安裝工具的命令。任何想法或選擇?

回答

2

嘗試divine verify file.dve 2>&1 | tee log.txt。如果程序輸出到stderr而不是stdout,這會將stderr重定向到stdout。

-1

作品的ffmpeg的輸出也

{ echo ffmpeg -i [rest of command]; ffmpeg -i [rest of command]; } 2>&1 | tee ffmpeg.txt 

和T -a追加,如果文件已經存在

======

此外,如果你想看到的MediaInfo上的所有文件在一個文件夾中並確保命令也在mediainfo.txt中可見

{ echo mediainfo *; mediainfo *; } 2>&1 | tee mediainfo.txt 

注意:{echo cmd ; CMD; }表示該命令保存在txt文件中;沒有這個,它不打印

相關問題