Create Stunning Linux Terminal GIFs with VHS: Install and Step‑by‑Step Guide
This guide explains how to install the VHS command‑line utility on various Linux distributions and use it to record terminal commands as animated GIFs, covering setup, tape file creation, command sequencing, and final GIF generation.
Linux terminals are powerful, but creating visual tutorials can be cumbersome; VHS (Video Home System) simplifies turning terminal sessions into animated GIFs.
Installing VHS
VHS requires ttyd and ffmpeg. Install ttyd via snap if supported: sudo snap install ttyd --classic On Debian‑based systems, add the Charm repository key and source, then install:
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
sudo echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ " | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update && sudo apt install vhsOn Arch Linux, use the AUR package: yay -S vhs-bin For Fedora and RHEL, add the Charm repo and install with yum:
echo '[charm]
name=Charm
baseurl=https://repo.charm.sh/yum/
enabled=1
gpgcheck=1
gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
sudo yum install vhsCreating a GIF with VHS
VHS uses files with the .tape extension. Create a new tape file: vhs new linuxmi.tape Edit the tape with your favorite editor (e.g., nano) and add commands. Useful directives include: Output filename.gif – set output file. Set FontSize 15, Set Width 1200, Set Height 600 – configure appearance. Type "command" – simulate typing a command. Sleep 200ms – pause before next line. Enter – simulate pressing Return. Hide / Show – hide or reveal subsequent commands.
Example tape content that records a custom neofetch display:
Output linuxmi.gif
Set FontSize 15
Set Width 1200
Set Height 600
Type "neofetch --ascii linuxmi.txt"
Sleep 500ms
Enter
Sleep 5sAfter saving the .tape file, generate the GIF: vhs < linuxmi.tape The resulting animated GIF captures the typed commands and their output, providing a compact visual tutorial.
Benefits
Using VHS to create terminal GIFs is quick, lightweight, and ideal for documentation, tutorials, or showcasing command‑line workflows without the overhead of video files.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
