美文网首页
Ubuntu终端输出到Log

Ubuntu终端输出到Log

作者: FrankOnTheWay | 来源:发表于2018-10-07 14:37 被阅读0次

1 Script

执行以下命令,开启并保存至相应文件:

script screen.log

即保存至screen.log中

完成之后执行:

exit

退出

注意:screen.log在当前目录下

2 tee

将命令正确执行和错误的输出结果都保存到文件log.log:

python class.py   2>&1 | tee  log.log -a

相关文章

网友评论

      本文标题:Ubuntu终端输出到Log

      本文链接:https://www.haomeiwen.com/subject/amelaftx.html