我们需要系统中已经安装script,scriptreplay.
比如我们可以通过如下的方式来完成。简单运行几个命令,然后通过回放来看是否能够一步一步的输出。
$ script -t 2> time.log -a record.session
Script started, file is record.session
$ echo begin
test begin
$ echo test start
test start
$ echo test end
test end
$ exit
exit
Script done, file is record.session
到此屏幕的录制就结束了,我们通过scriptreplay来回放这个过程。
$ scriptreplay time.log record.session
输入这个命令之后,你就会看到屏幕好像被人操纵了一样,一步一步的运行命令,然后输出,感觉很有成就感。
如果你需要在别的机器上查看这个过程,可以把time.log和record.session这个两个生成的文件拷贝过去,直接运行命令即可。
时间戳文件的内容如下。都是记录了一点点的操作时间信息。
$ cat time.log
0.350314 17
0.052705 1
1.176860 1
0.241008 1
0.064975 1
。。。。
以上就是为各位朋友分享的相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多等着你!