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 asciinemaCentOS 8 / Rocky Linux 8
sudo dnf install -y epel-release
sudo dnf install -y asciinemaStep 2: Record a Terminal Session
Start recording with the asciinema rec command:
asciinema rec demo.castExplanation:
demo.cast– file where the recording will be saved.- After running the command, perform your terminal operations as usual.
- Press Ctrl+D or type
exitto stop recording.
Step 3: Play Back Your Recording Locally
asciinema play demo.castThis 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.castAfter 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.
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