How to capture terminal sessions and output with the Linux script command

447

How to capture terminal sessions and output with the Linux script command

The Linux script command allows you to create replayable terminal sessions by simply entering commands.
khess
Tue, 1/19/2021 at 4:12pm

Image

Photo by Sora Shimazaki from Pexels

The Linux script command creates a typescript file from your terminal session. This means that if you invoke the script command, you are dropped to a “watched and recorded” terminal session subshell that’s saved to an ASCII text file. When created with a timing file, you can replay the session, including output. The purpose of script is that you can easily grab sample output from any command through an interactive session exactly as it’s displayed in your terminal. You can use backspace, edit files, create files, and run simple or complex commands.

Topics:  
Linux  
Command line utilities  
Read More at Enable Sysadmin