Linux record terminal session and replay it


We can record and reply a terminal/konsole session with script command and reply it with scriptreply command.

Here is the example to record the session:

$ script -t 2> timing.txt -a session.txt


Script started, file is session.txt

Now you can start typing some commands.

$ echo "Hello world"
$ date

To stop recording run exit command.

$ exit

In above session we ran echo, date commands, and stored output in timings.txt and session.txt

To replay recorded session use scriptreplay as shown below:

$ scriptreplay timing.txt session.txt

It will print/replay whole session that we recorded.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s