1 Script
执行以下命令,开启并保存至相应文件:
script screen.log
即保存至screen.log中
完成之后执行:
exit
退出
注意:screen.log在当前目录下
2 tee
将命令正确执行和错误的输出结果都保存到文件log.log:
python class.py 2>&1 | tee log.log -a
执行以下命令,开启并保存至相应文件:
script screen.log
即保存至screen.log中
完成之后执行:
exit
退出
注意:screen.log在当前目录下
将命令正确执行和错误的输出结果都保存到文件log.log:
python class.py 2>&1 | tee log.log -a