我尝试过使用tee>将终端输出重定向到文件,如herequestion示例中所示。它对echo test | tee log.txtls -l | tee log.txt有效
但是当我运行类似divine verify file.dve | tee log.txt的命令时,它不起作用(不向log.txt添加任何内容)
神是一个安装的工具。有什么想法或选择吗?

最佳答案

尝试divine verify file.dve 2>&1 | tee log.txt。如果程序输出到stderr而不是stdout,则将stderr重定向到stdout。

关于linux - 如何将ubuntu终端输出重定向到文件?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17813669/

10-13 05:30