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.
チャンネル別に見る
自動化
テクノロジー、チームおよび環境に関する IT 自動化の最新情報
AI (人工知能)
お客様が AI ワークロードをどこでも自由に実行することを可能にするプラットフォームについてのアップデート
オープン・ハイブリッドクラウド
ハイブリッドクラウドで柔軟に未来を築く方法をご確認ください。
セキュリティ
環境やテクノロジー全体に及ぶリスクを軽減する方法に関する最新情報
エッジコンピューティング
エッジでの運用を単純化するプラットフォームのアップデート
インフラストラクチャ
世界有数のエンタープライズ向け Linux プラットフォームの最新情報
アプリケーション
アプリケーションの最も困難な課題に対する Red Hat ソリューションの詳細
オリジナル番組
エンタープライズ向けテクノロジーのメーカーやリーダーによるストーリー
製品
ツール
試用、購入、販売
コミュニケーション
Red Hat について
エンタープライズ・オープンソース・ソリューションのプロバイダーとして世界をリードする Red Hat は、Linux、クラウド、コンテナ、Kubernetes などのテクノロジーを提供しています。Red Hat は強化されたソリューションを提供し、コアデータセンターからネットワークエッジまで、企業が複数のプラットフォームおよび環境間で容易に運用できるようにしています。
言語を選択してください
Red Hat legal and privacy links
- Red Hat について
- 採用情報
- イベント
- 各国のオフィス
- Red Hat へのお問い合わせ
- Red Hat ブログ
- ダイバーシティ、エクイティ、およびインクルージョン
- Cool Stuff Store
- Red Hat Summit