In my line of work, as well as in many hands-on technical positions, there are times when recording your work is necessary. Sometimes, it’s an advanced form of note-taking; other times, it's a quick and easy way to send someone junior a how-to. You could even record your terminal for "insurance" if you are the paranoid type. Either way, there is no denying that terminal recording software is a neat and practical tool to have in your arsenal.

So, in exploring some of the various ways to do this, I came across what is easily my favorite terminal recorder. Asciinema (pronounced as-kee-nuh-muh) is a free, open source software built exclusively for terminal session recording. But it allows you to take the recordings a step further and share them via the web (you can send an embed code or the source file as needed).

[ Readers also liked: Sysadmin skills: What junior sysadmins need to know ]

Installation

For the examples you will see below, I am using a Fedora 33 workstation. For information on installing to other operating systems, see the install documentation.

To install: sudo dnf install asciinema

From my terminal:

[tcarrigan@client ~]$ sudo dnf install asciinema
[sudo] password for tcarrigan: 
Fedora Modular 32 - x86_64                       26 kB/s |  14 kB     00:00    
Fedora Modular 32 - x86_64 - Updates             62 kB/s |  14 kB     00:00    
Fedora Modular 32 - x86_64 - Updates            184 kB/s | 182 kB     00:00    
Fedora 32 - x86_64 - Updates                     33 kB/s |  14 kB     00:00    
Fedora 32 - x86_64 - Updates                    3.3 MB/s | 6.2 MB     00:01    
Package asciinema-2.0.2-2.fc32.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!

As you can see above, the install is complete. Now, how do we actually make use of this software?

Basic usage

The most basic use of this software is to create a recording, so that is where we will start. To start recording your terminal, you will use the command:
asciinema rec [filename] . At this point, you will want to run whatever commands that you wish to record. When you are ready to end the recording, you will use Ctrl + D or type exit. Here’s what this looks like.

[tcarrigan@client ~]$ asciinema rec terminal_rec_demo
asciinema: recording asciicast to terminal_rec_demo
asciinema: press <ctrl-d> or type "exit" when you're done
[tcarrigan@client ~]$ This is how you record a terminal session. When finished...just use Ctrl+D
bash: This: command not found...
[tcarrigan@client ~]$ exit
asciinema: recording finished
asciinema: asciicast saved to terminal_rec_demo

You can now find the raw file in your home/user directory.

[tcarrigan@client ~]$ ls -l
total 752
drwxr-xr-x. 2 tcarrigan tcarrigan   4096 Jun 24 12:29 Desktop
drwxr-xr-x. 2 tcarrigan tcarrigan   4096 Aug  3 21:48 Documents
drwxr-xr-x. 2 tcarrigan tcarrigan   4096 Jun 24 12:29 Downloads
drwxr-xr-x. 2 tcarrigan tcarrigan   4096 Jun 24 12:29 Music
drwxr-xr-x. 2 root      root        4096 Jun 25 16:48 p
drwxr-xr-x. 2 tcarrigan tcarrigan   4096 Jun 24 12:29 Pictures
drwxr-xr-x. 2 tcarrigan tcarrigan   4096 Jun 24 12:29 Public
-rw-rw-r--. 1 tcarrigan tcarrigan  32553 Nov  6 17:12 tail_demo
-rw-rw-r--. 1 tcarrigan tcarrigan 690827 Nov  6 17:12 tcpdump.txt
drwxr-xr-x. 2 tcarrigan tcarrigan   4096 Jun 24 12:29 Templates
-rw-rw-r--. 1 tcarrigan tcarrigan   2532 Dec  7 15:14 terminal_rec_demo
drwxrwxr-x. 3 tcarrigan tcarrigan   4096 Jun 25 16:48 test
drwxr-xr-x. 2 tcarrigan tcarrigan   4096 Jun 24 12:29 Videos

Now that you have your recording, how can you share it? That is where this tool gets really neat.

Sharing

In order to share your recording, you need to first get the file onto the web. You can start by uploading your file to the asciinema.org site. To do this, you will use the upload <filename>command. Now, for this to work, you need to authenticate your terminal with your account on the asciinema website. For more information on how to do this, you should see the "auth" section of the following webpage (toward the bottom).

Once you have uploaded your recordings to the webpage, you can log into your account and view them. Once you are here, it’s as simple as grabbing the embed code or URL and using it as needed. If all goes well, you should see something very similar to the following example.

 

This is the final product from the output in the "Basic Usage" section.

[ Get this free ebook: Managing your Kubernetes clusters for dummies. ]

That's a wrap

If you found this helpful, I encourage you to give this tool a try in your next blog or, when someone needs you to show them how to do it, you can just send them this recording so that they can reference it as needed!


저자 소개

Tyler is the Sr. Community Manager at Enable Sysadmin, a submarine veteran, and an all-round tech enthusiast! He was first introduced to Red Hat in 2012 by way of a Red Hat Enterprise Linux-based combat system inside the USS Georgia Missile Control Center. Now that he has surfaced, he lives with his wife and son near Raleigh, where he worked as a data storage engineer before finding his way to the Red Hat team. He has written numerous technical documents, from military procedures to knowledgebase articles and even some training curricula. In his free time, he blends a passion for hiking, climbing, and bushcraft with video games and computer building. He is loves to read and enjoy a scotch or bourbon. Find him on Twitter or on LinkedIn.

UI_Icon-Red_Hat-Close-A-Black-RGB

채널별 검색

automation icon

오토메이션

기술, 팀, 인프라를 위한 IT 자동화 최신 동향

AI icon

인공지능

고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트

open hybrid cloud icon

오픈 하이브리드 클라우드

하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요

security icon

보안

환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보

edge icon

엣지 컴퓨팅

엣지에서의 운영을 단순화하는 플랫폼 업데이트

Infrastructure icon

인프라

세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보

application development icon

애플리케이션

복잡한 애플리케이션에 대한 솔루션 더 보기

Virtualization icon

가상화

온프레미스와 클라우드 환경에서 워크로드를 유연하게 운영하기 위한 엔터프라이즈 가상화의 미래