Chinaunix首页 | 论坛 | 博客
  • 博客访问: 120094
  • 博文数量: 87
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 0
  • 用 户 组: 普通用户
  • 注册时间: 2017-12-21 12:14
文章分类

全部博文(87)

文章存档

2015年(10)

2014年(2)

2013年(6)

2012年(69)

我的朋友

分类: LINUX

2012-07-06 10:03:28

script 记录回话的一切内容
默认情况下,你要去目录的typescript文件中写入内容,然后,你输入的一切内容都被
记录到那个文件中,script/path/file 往另一个文件中记录日志
如:
script screen.log 说明打开script,file是 screen.log
ls -ltr 屏幕的输出内容
exit 结束script,此时屏幕输出的内容已经到screen.log中

异常退出没有问题此时加上参数 script -f ido.log。
如果在一个终端上使用mkfifo ido.log;script -f ido.log 然后在另一个终端登陆
找到这个ido.log文件,你tail -f就会滚动输出你操作的内容

script -L
exit
生成一个screenlog.0文件
more screenlog.0 查看刚才进行的操作



script
exit
生成一个typescript文件 more查看
 



make 2>&1 | tee make.log
直接重定向  make > make.log
2>&1   为了记录错误日志
cat screenlog.0 | col -b > screen.log
or
cat typescript | col -b > scriptlog
执行 script -q tty.log 后,就开始记录终端输入输出信息,结束的时候ctrlD自动生成tty.log


阅读(1130) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~