Bkjia: Suppose you are a reliable gentleman. Whenever friends and family encounter various issues related to Linux, they always ask for help immediately. Someone will ask you how to install and configure a tool. At this time, you will want to know the specific steps. But what should I do if the other party is not with you? There may be many solutions. For example, you can record the specific steps in the document, and then send them via email; or call and inform the other party in detail, but the most clear solution is your own demonstration. If you only need one terminal for demonstration, the best way is to use the terminal screen play or terminal session recorder.
In this tutorial, I will demonstrate how to record and play back terminal sessions on Linux.
There are several online service websites, such as showterm. io or asciinema.org, that allow you to record and share your terminal sessions on the Internet. However, if you want to ensure privacy or store the recorded content locally, we recommend that you use TermRecord.
TermRecord is an open-source tool written in Python. It records terminal sessions into an independent HTML file. Since the output file in HTML format is an independent file, anyone can use a cross-platform Web browser to play back the recorded terminal session.
Install TermRecord on Linux
TermRecord is provided as a Python package, so you can install the package using the pip command.
First, install pip on your Linux system. For more information, see http://ask.xmodulo.com/install-pip-linux.html. Then, install TermRecord as follows.
- $ sudo pip install TermRecord
Use TermRecord recording terminal session
It is easy to use the TermRecord recording terminal for session. You only need to run the following command to start recording.
- $ TermRecord -o /path/to/output_html
For example, to save the current terminal session in/tmp/session.html, run the following command:
- $ TermRecord -o /tmp/session.html
Then, any command entered from the terminal will be saved to the HTML output file. The output file also stores time information, so that the entire terminal session can be played back at the same speed as you typed.
If you want to stop recording, just type "exit" and press the Enter key.
If you open HTML output results in a Web browser, you can play, pause, or restart stored sessions. You can also adjust the playback speed. That is, you can speed up or slow session playback as needed, as you like.
The following is an example terminal screen play http://xmodulo.com/wp-content/uploads/2014/05/session.html generated by TermRecord ).