我已经尝试使用tee
和>
将终端输出重定向到文件,如示例here和question中的示例。它为echo test | tee log.txt
或ls -l | tee log.txt
如何将ubuntu终端输出重定向到一个文件?
,但它不能正常工作(不添加任何东西到log.txt中),当我运行像divine verify file.dve | tee log.txt
神圣的地方是一个安装工具的命令。任何想法或选择?
我已经尝试使用tee
和>
将终端输出重定向到文件,如示例here和question中的示例。它为echo test | tee log.txt
或ls -l | tee log.txt
如何将ubuntu终端输出重定向到一个文件?
,但它不能正常工作(不添加任何东西到log.txt中),当我运行像divine verify file.dve | tee log.txt
神圣的地方是一个安装工具的命令。任何想法或选择?
尝试divine verify file.dve 2>&1 | tee log.txt
。如果程序输出到stderr而不是stdout,这会将stderr重定向到stdout。
作品的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文件中;没有这个,它不打印