How to Record Terminal Session on Linux with TTYRec

Recording a terminal session could be important to create some learning material or references to someone, or just a sharing information in much understandable way. Unlike using Desktop Capture  software like RecordMyDesktop or Kazaam. You can use TTYRec as simple app to record your terminal sessions. Its small and compact, and can produce a gif output!

To record terminal session, you need TTYRec to be installed. In Ubuntu/Debian, you can install it with:

sudo apt-get install ttyrec

And to produce .gif you need imagemagick and python-opster.

sudo apt-get install python-opster imagemagick

To capturing the terminal session, you just need to simply start with ttyrec + enter. This will launch the real-time recording tool which will run in the background until we enter “exit” or we press “Ctrl+D”. By default, ttyrec creates a file named “ttyrecord” on the destination of the terminal session which by default is “Home”.

And to play your file, you can use ttyplay. Playing the file is as simple as opening a terminal on the destination of the “ttyrecord” file and using the “ttyplay” command followed by the name of the recording (in our case it’s ttyrecord but you may change this into whatever you want).

This will result in the playback of the recorded session, in real-time, and with typing corrections included (all actions are recorded). This will look like a completely normal automated terminal session, but the commands and their apparent execution are obviously not really applied to the system, as they are only reproduced as a recording.

It is also important to note that the playback of the terminal session recording is completely controllable. You may double the playback speed by hitting the “+” button, slow it down with the “-” button, pause it with “0”, and resume it in normal speed with “1”.