How To Replay The Recorded Terminal Classes Utilizing Scriptreplay Command

0

Get real time updates directly on you device, subscribe now.

Some time in the past, we now have discovered the way to document all the things you do in Terminal utilizing Script command on Linux. Utilizing Script command, we are able to document the Terminal periods in a typescript file and think about them later utilizing Cat command or another textual content viewing functions. Immediately, we’re going to see how replay the recorded Terminal periods utilizing Scriptreplay command on Linux.

The Scriptreplay is used to replay a typescript created by the “Script” command to the usual output. It’s a part of the util-linux package deal on RPM-based methods and bsdutils package deal on DEB-based methods and it comes pre-installed on most fashionable Linux working methods. So, we don’t want to put in it.

Replay Recorded Terminal Classes Utilizing Scriptreplay

As chances are you’ll already know, the cat command will solely the show typescript, however gained’t play them. If you wish to replay the Terminal exercise as a substitute of simply viewing it, use “scriptreplay” command.

To replay the terminal actions utilizing scriptreplay, it’s essential to first document it utilizing “script” command with timing info in a file utilizing -t parameter like under.

$ script -a my_terminal_activities -t=time.log

Or,

$ script -a my_terminal_activities –timing=time.log

Right here,

terminal.log is the the file that comprises timing output of the typescript. You should use any identify of your selection, for instance time.txt, timing.log and so on.
my_terminal_activities is the file that comprises the output script’s terminal output i.e. all recorded terminal actions.

Now, do no matter you wish to do in your Terminal. For instance, I’m going to run some random Linux instructions in my Terminal.

$ lsb_release -a

$ uname -a

After operating all instructions, finish the recording with command:

$ exit

After performed with the recording, merely replay it with command:

$ scriptreplay -t=time.log my_terminal_activities

Or,

$ scriptreplay –timing=time.log my_terminal_activities

This command will begin to replay the recorded terminal session as a substitute of simply displaying the entire exercise.

Here’s a pattern output from my Ubuntu 18.04 system:

Play Recorded Terminal Sessions Using Scriptreplay Command On Linux

Improve or lower playback velocity

By default, Scriptreplay will replay the output on the similar velocity as the best way it initially appeared when the typescript was recorded. You may, nevertheless, enhance or lower the playback velocity as you please.

For instance, to replay the typescript at double(i.e. 2x velocity) the unique velocity, run:

$ scriptreplay -t=terminal.log my_terminal_activities 2

To replay a typescript at half the unique velocity:

$ scriptreplay -t=terminal.log my_terminal_activities zero.5

To replay script with ten occasions slower than the unique velocity, run:

$ scriptreplay -t=terminal.log my_terminal_activities zero.1

Please notice that Scriptreplay merely shows the session exercise recorded with Script command. It is not going to truly run the instructions/packages that had been run when the typescript was recorded. Because the similar info is just being displayed, scriptreplay is barely assured to work correctly if run on the identical kind of terminal the typescript was recorded on.

For assist, run:

$ scriptreplay –help

Utilization:
scriptreplay [-t] timingfile [typescript] [divisor]

Play again terminal typescripts, utilizing timing info.

Choices:
-t, –timing script timing output file
-s, –typescript script terminal session output file
-d, –divisor velocity up or decelerate execution with time divisor
-m, –maxdelay wait at most this many seconds between updates
-h, –help show this assist
-V, –version show model

Extra particulars might be discovered within the man pages.

$ man scriptreplay

Steered learn:

Thanks for stopping by!

Assist us that can assist you:

Have a Good day!!

Source link

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More