script Command in Linux: Record and Replay Full Terminal Sessions
The script and scriptreplay tools can be used to create a script of all commands typed in the shell, so they can be printed, or played back as a "replay" in the same shell, maintaining their order and chronology.
To create a script of the shell session, you can use the script command:
$ script arquivo.log
Everything that is typed and printed on the screen will be recorded in the arquivo.log file, until the "exit" command is executed.
The arquivo.log will have the typescript format that can be printed.
But these tools become amazing with the "--timing" option, which creates a timing file, allowing you to "play" the script as a replay:

$ script --timing=tempo.txt arquivo.log
After typing all the commands, and exiting script with "exit", you can play back what was recorded with scriptreplay.
This way, the scriptreplay command can be used to display on the screen everything that was typed, at the same speed, as if it were a "movie":
$ scriptreplay -t time.txt script.log

These two commands can be extremely useful for documenting a software installation process, troubleshooting a problem, for training purposes, etc.
Learn much more about Linux in our online course. You can enroll here. If you already have an account, or want to create one, just log in or create your user here.
Did you like it? Share
That was just one piece. The course teaches the whole path — from your first command to exam day.