• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • AI Agents
    • OpenClaw
    • Claude Code
    • n8n
    • Hermes Agent
    • Open WebUI
    • Docker
  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
    • Email Hosting
    • HeroicGuard
    • GPU Hosting
    • Website Builder
  • VPS
    • Managed VPS
    • Unmanaged VPS
    • Flex VPS
  • Reseller
  • Gaming
  • Domains
  • Account
  • Blog Home
  • Categories
  • Authors

How To Record Your Terminal Window On Linux

CJ Saathoff

Published on: November 20, 2024

Categories: Linux Command Line 0

Although you can use traditional screen recording software to capture your screen, there are better solutions. I’m introducing Asciinema, a tool specifically made to record terminal sessions. What makes this tool better, you ask? In this blog post, we will discuss that very thing, from features to how to install, record, and playback the recordings, and more.

Table of Contents
  • Features
  • How To Install
    • Installing The Python Package Directly
  • Recording
  • Playback
  • Bonus: Recording All Your SSH Sessions
  • Conclusion

Features

Below is a list of some of the most important features.

  • smaller files than traditional screen recording software
  • copy and paste from recordings
  • Is Open Source
  • Cross-platform Support
  • Customization during Playback
  • Embedding and Sharing

How To Install

There are two main ways to install Asciinema one is to search your systems package manager for Asciinema and the other is to install the Python package directly.

Apt-based distros such as Debian or Ubuntu:

apt install asciinema

DNF-based distributions such as AlmaLinux, CentOS, Fedora, RHEL, and more:

dnf install asciinema

For Arch Linux and Arch-based Distros:

pacman -S asciinema

Installing The Python Package Directly

If your distro doesn’t have a direct package for asciinema, you can use a Python package manager like pip or pipx to install the package.

Using pip:

python3 -m pip install asciinema

Using pipx:

pipx install asciinema

Recording

To start recording a terminal session you first need to decide if you want to record the file locally or upload it to asciinema.org.

To record locally make sure to specially a filename

asciinema rec filename.cast

If you don’t have anything personal you plan to record and are fine uploading it publicly you don’t have to specify the filename.

Playback

Playback can be customized, but before we look at the options let’s look at basic playback.

asciinema play [filename or URL of cast file]

This will play the recording as it was recorded (if the recording was 5min so is playback).

Below are the most common options you will want on playback

-i, –idle-time-limit limit idle time during playback to a given number of seconds

-s, –speed set playback speed (can be fractional)

-l, –loop loops the playback over and over again

Bonus: Recording All Your SSH Sessions

Do you need to record all your ssh sessions? The function below catches any commands starting with SSH then runs them through asciinema and records them to a folder called asciinema in your home directory.

function ssh {

 ssh=$(whereis -b ssh | cut -d' ' -f2)
 SESSION_NAME="ssh-$(date +%Y%m%d-%H%M%S)"

 # Create asciinema recording (for users not using sshrc)
 asciinema rec -y "$HOME/asciinema/$SESSION_NAME.cast" --command "$ssh $@"

}

Conclusion

Asciinema is a tool designed specifically recording terminal sessions, in this blog post we touched on features compared to traditional screen recording software. Then moved one to how to install, record, and playback the recordings. As I only touched the surface if you looking for other features or more intonation please check out asciinema docs site as it goes into much more detail than we can in a single blog post.

CJ Saathoff

Embracing a lifelong passion for technology since childhood, CJ delved into the intricate workings of systems, captivated by the desire to understand the unknown. This innate curiosity led to his discovery of Linux, a revelation that resonated deeply. With more than 7 years of on the job experience, he’s honed his technical skills as a Geek and Senior Linux Systems Administrator.

Related Posts

Using Bash Job Controls to Manage Multiple Processes

Bash job controls are used to send long running tasks into the background, and bring them forward when necessary.

Docker Build Cache – How it Works and Invalidating it

Docker heavily optimizes its build process with caching to save time. But it's important to know how to invalidate it.

Using the “whois” Command – All you Need to Know

If you want to know about who owns a domain, or when it expires, then you need to use the "whois" command. Here's all you need to know.

How to Use the xargs Command in Linux

The "xargs" command converts text from standard input into arguments, allowing the output for one command to be used as arguments in other.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • OpenClaw Hosting
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • Managed VPS Hosting
  • Unmanaged VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • GPU Hosting
  • Email Hosting
  • HeroicGuard
  • Domains
  • Website Builder
  • AI Agent Hosting
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2026 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA