script & ttyrec: record full terminal sessions

terminalIf you want a typescript record of everything that shows up on a terminal session, script & scriptreplay combo is the exact utility you are looking for. A common use is that you can record every activity during a terminal session and the replay it later. Here’s an example:

Start recording with time information in timefile and activity record in recordfile:

$ script -ttimefile recordfile

When invoked, script starts running in the background. Everything you do from here gets recorded. To finish recording press ^D.

To reply the session, use scriptreplay:

$ scriptreplay -ttimefile recordfile

Try it yourself. Amazing, isn’t it?

This can also be done using the more advanced utilities ttyrec and ttyplay. Usage is almost similar but ttyrec does not need any extra file to record times.

3 thoughts on “script & ttyrec: record full terminal sessions”

Leave a Reply

Your email address will not be published. Required fields are marked *