> ## Content Index
> Fetch the complete content index at: https://en.blog.themarfa.name/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Record Terminal Sessions on Linux Using asciinema
- URL: https://en.blog.themarfa.name/how-to-record-terminal-sessions-on-linux-using-asciinema/
- Published: 2025-05-24T12:13:49.000Z
- Updated: 2025-05-24T12:15:22.000Z
- Description: asciinema is a tool for recording terminal sessions into .cast files, which can be replayed and shared without the need for screencasts.
- Author: Konstantin Dokuchaev
- Tags: linux, asciinema

To be honest, I’m not sure why you would want to record your terminal sessions using anything other than a screencast application. However, if you’re curious about how to do it with asciinema, I’ll explain it here.

[**asciinema**](https://asciinema.org/) is a command-line utility that allows you to record terminal activity without using any special applications. The recordings are saved in a format that can be replayed using the same tool.

To install asciinema, you’ll first need to install pipx using the command `sudo apt install pipx`, and then you can install asciinema itself with `pipx install asciinema`.

There are alternative installation options as well, which you can explore on [this page](https://asciinema.org/docs/installation).

To start recording a terminal session, use the command:

```
asciinema rec test.cast
```

Here, .cast is the name of your future recording file.

Now, you can perform any necessary actions in the terminal, and they will be recorded automatically. To stop the recording, press Ctrl+D or type exit.

The completed recordings will appear in the user’s home directory as .cast files.

![](https://storage.ghost.io/c/31/c7/31c7da9c-f519-464c-9a3b-2d4144b557a6/content/images/2025/05/image-33.png)

To play back a recorded file, use the command:

```
asciinema play test.cast
```

You can share these recordings with the world on asciinema’s official website using the command:

```
asciinema upload demo.cast
```

Below you can see an example of such a recording:

[Try asciinema](https://asciinema.org/)