Cyber Services / All lessons / CentOS / Linux Administration / Asciinema Terminal Recording

Asciinema Terminal Recording

Module 33 of 33 · 1 min read · Free to read

MODULES ↓ Command blocks have a COPY button

Record, Share, and Replay Your Terminal Sessions on Linux

Asciinema is a lightweight terminal session recorder for Linux systems. It allows you to record your terminal commands, share them as small, fast animations, and replay them in any web browser. Unlike screen-recording tools, asciinema creates text-based recordings, keeping files small and easy to edit.

Step 1: Installing Asciinema

Installation differs slightly depending on your Linux distribution.

Kali Linux / Debian

sudo apt update
sudo apt install -y asciinema

CentOS 8 / Rocky Linux 8

sudo dnf install -y epel-release
sudo dnf install -y asciinema

Step 2: Record a Terminal Session

Start recording with the asciinema rec command:

asciinema rec demo.cast

Explanation:

  • demo.cast – file where the recording will be saved.
  • After running the command, perform your terminal operations as usual.
  • Press Ctrl+D or type exit to stop recording.

Step 3: Play Back Your Recording Locally

asciinema play demo.cast

This will replay the terminal session in your current terminal.

Step 4: Upload Recording to Asciinema.org

You can share your recording online by uploading it:

asciinema upload demo.cast

After uploading, you will get a URL to share your recording publicly.

Step 5: Additional Tips & Options

  • Record without saving locally: asciinema rec (press Ctrl+D to upload)
  • Resize terminal for recording: asciinema rec demo.cast --columns 120 --rows 30
  • Embed in HTML: Use the URL from asciinema.org to embed in web pages.
  • Automate recording: Combine asciinema with scripts for tutorials or demos.
Example Lab

1. Open a terminal in Kali or Rocky Linux.
2. Run asciinema rec mysession.cast
3. Run commands like ls -la, df -h, uname -a
4. Exit recording with exit
5. Play locally: asciinema play mysession.cast
6. Upload: asciinema upload mysession.cast

Modules (33) ← CentOS / Linux Administration