- [Narrator] Hi again and welcome to this second video
of the second section,
Recording and Playing Back of Terminal Sessions.
In the previous video,
we learned about concatenating with CAT.
In this video, we'll to record and
playback of terminal sessions by using the command line.
When you need to show somebody
how to do something in the terminal,
or you need to prepare a tutorial
on how to do something through the command line,
you would normally type the commands manually and show them.
Or, you could record a screencast
and play back the video to them.
There are other options for doing this.
Using the commands Script and Script Replay,
we can record the order and timing of commands
and save the data to text files.
Using these files, others can replay
and see the output of the commands on the terminal,
until the playback is complete.
The Script and Script Replay commands are available
in most of the GNU/Linux distributions.
Recording the terminal session
to a file will be interesting.
You can create tutorials of a command line,
hacks and tricks to achieve
a task by recording a terminal session.
You can also share the recorded files
for others to play back,
and see how to perform a particular task
using the command line.
We can start recording the terminal session
using the following commands.
Note that this section will not work with shells
that do not support redirecting only to STDA,
to a file such as CSH shell.
Two configuration files are passed
to the script commander's arguments.
One file is for storing timing information,
Timing.log, at which each of the commands is run.
Whereas the other file, output.session,
is used for storing the command output.
The minus T flag is used to dump timing data to STDA.
Here, you will see two greater than is used
to redirect STDA to timing.log.
By using the two files,
timing.log stores timing information
and output.sessions stores command output information,
we can replay the sequence of command execution as follows.
Usually, we record desktop videos to prepare tutorials.
However, these videos require
a considerable amount of storage.
On the other hand,
a terminal script file is just a text file,
usually, only in the order of kilobytes.
You can share the timing.log and output.session files
to anyone who wants to replay a terminal session
in their terminal.
Awesome.
In this video, we've successfully learned
how to record and playback of terminal sessions.
In the next video,
we'll see how to find files and file listing.