A lot of people are probably not aware of the command
script. Script is a quick and easy way to record everything you do in a terminal session. I use script to record sessions of me fixing a server, or troubleshooting Linux issues, and save it for future needs, or to pass on to others as training material. Here is what the Linux man page says:
Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1).
Using script to record your terminal session
It’s really quite simple to record your bash session. All you need to do is type
script -a filename to start recording your session:
Now that the recording has started, everything you type, as well as everything that returns as output, will be saved into the filename you chose to output to.