‘script’ is mentioned on different blogs and and pages but I couldn’t get it to run until I came across this blog post by Ken Hess: https://www.redhat.com/sysadmin/linux-script-command
It’s fairly simple…. run ‘script -O <name_of_a_file> to start, you will get ‘Script started, output log file….’
Press Ctrl+d when you’re done and you will get a confirmation ‘Script done’
You can view the saved file using cat.
Where I ithought it doesn’t work is that the output file looks exactly like the terminal. You almost have to look very hard to a line like ‘Script started ….’ But work it does. And it can be a real time and life-saver for documentation.