Linux Cmd Tool 系列之—script & scriptreplay,to

Linux Cmd Tool 系列之—script & scriptreplay,toolscript

Intro

Sometime we want to record cmd and outputs in the interactive shell sessions. However history cmd cannot do this. So we need cmd line recording tool like script and scriptreplay.

References

Master's Shoulder:How to Record and Replay Linux Terminal Sessions using ‘script’ and ‘scriptreplay’ Commands

Key Points

script cmdhist.log

This starts the script recording process, which underlyingly is spawning a new shell, all successive cmds you type is in the new shell.

exit

This exits the new shell created by script cmd.

script --timing=time.log cmdhist.log

This will populate another time.log file that keeps the timestamp of each historical cmd step. 

To replay such cmdhist.log, you need time.log and scriptreplay cmd.

scriptreplay --timing=time.txt script.log

 

Cmd Tool 系列之—script scriptreplay,toolscript Intro Sometime we want to record cmd and outputs in the interactive shell sessions. However history cmd cannot do this....

本文由金沙澳门官网-www.js333com-金沙js333com发布于金沙澳门官网计算机,转载请注明出处:Linux Cmd Tool 系列之—script & scriptreplay,to

您可能还会对下面的文章感兴趣: