使用script命令于ubuntu中捕获终端数据输出

在ubuntu中需要捕获终端数据,欲保存运行命令及其执行过程输出信息时,可使用script命令。

man手册上的介绍如下:

DESCRIPTION
     script makes a typescript of everything printed on your terminal.  It is
     useful for students who need a hardcopy record of an interactive session
     as proof of an assignment, as the typescript file can be printed out
     later with lpr(1).


     If the argument file is given, script saves all dialogue in file.  If no
     file name is given, the typescript is saved in the file typescript.


另外,结合scriptreplay命令的使用,可实现终端操作的录制与回放。

例如: script -t 2>test.time -a test.log  完成录制

             scriptreplay test.time test.log    回放操作录像

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值