- 恋花2017-06-05金牌会员52314
1. 在screen的设置文件/etc/screenrc里添加一行logfile /tmp/screenlog.txt
sed -i '/logfile/d' /etc/screenrc;echo "logfile /tmp/screenlog.txt" >> /etc/screenrc;
2. screen 命令有个-L参数,功能是Turn on output logging. 以后只要加上这个参数,就会记录到文件了
screen -S test -L
3. 随手执行几个命令,比如ls top,之后查看/tmp/screenlog.txt文件,发现screen输出的内容都在里面了.
tail -n 100 /tmp/screenlog.txt
为毛发这帖子:
因为我本来是来发帖问的,还打了一大堆字,结果发帖过程中搜索到资料了,就顺便发一下.