Command script on Linux (recording commands)
The script and scriptreplay tools can be used to create a script of all the commands entered in the shell, so that they can be printed, or played as if it were one” replay” in the shell itself, maintaining its order and chronology.
To create a shell session script, you can use the script command:
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 look incredible with the “—timing” option, which creates a time file, making it possible to “play” the script like a replay:
``` $ script —timing=time.txt arquivo.log
$ scriptreplay -t time.txt script.log