Here, I am going to demonstrate how to record a terminal session on Linux.There are several online services (e.g., showterm.io or asciinema.org) which allow you to record and share your terminal sessions on the web. However, if you want privacy, or want to archive the recordings locally, I would recommend TermRecord.
TermRecord is an open-source tool written in Python, which records a terminal session into a standalone HTML file. Since the HTML-formatted output file is self-contained, anyone can replay the captured terminal session using a web browser, which is cross-platform.
Install TermRecord on Linux
For example, to save the current terminal session in /opt/session.html:
Here You can see inside the /opt directory there two files seesion.html & typescript.
now you need to download this typescript file and just browse it .
If you want to stop the recording, simply type “exit” and press ENTER.
If you open up the HTML output on a web browser, you can play, pause or restart the stored session. You can also adjust the replay speed, i.e., speed up or slow down the session replay as you like.
Here is a sample terminal screencast generated by TermRecord