$cmatrix
The classic terminal program that turns your command line into the falling green code from The Matrix. One command, zero setup, endless digital rain.
A screensaver for people who live in the terminal
cmatrix simulates the digital rain seen in The Matrix movies, streams of characters scrolling down the screen, right inside a terminal window. It was written by Chris Allegretta in 1999 and is now maintained on GitHub, built on the ncurses library so it runs on virtually any POSIX system.
It serves no practical computing purpose. It exists to make your terminal look good, to fill an empty screen at a hackerspace, or to relive a piece of late-90s internet culture whenever you type one word.
- Original author
- Chris Allegretta
- First released
- 1999
- Built with
- C, ncurses
- Platforms
- Linux, macOS, BSD, Unix
- License
- GNU GPL, free & open source
- Command
- cmatrix
Small tool, a surprising number of dials
Every visual detail can be tuned from the command line, and most of it can be changed live while cmatrix is already running.
Eight colors
Switch between green, red, blue, yellow, cyan, magenta, white, or black at launch.
Update speed
Set the screen refresh delay to make the rain crawl or sprint down the terminal.
Async scroll
Let columns fall independently for the chaotic look from the original film.
Bold text
Mix in bold characters, or make every character bold for a heavier look.
Screensaver mode
Run until any key is pressed, ideal for an idle terminal or a demo screen.
Console font
Use the Linux console matrix.fnt font for the closest match to the movie.
Should you install cmatrix? Here's the honest answer
cmatrix is a tiny program, so there isn't much to weigh, but here's exactly what you get and what you don't before you run the install command.
Pros of cmatrix
- Fully open source. Released under the GPL, the actual C source is public on GitHub for anyone to read, audit, or modify.
- Already packaged for you. It ships in the default repositories of Ubuntu, Debian, Fedora, and Arch, and is available via Homebrew on macOS, no manual compiling needed.
- Everything is a flag, not a config file. Color (-C), speed (-u), boldness (-b/-B), and async scroll (-a) are all set at launch, with nothing to configure beforehand.
- One lightweight binary. Built on ncurses with no GUI toolkit, background service, or network access required to run.
- Doubles as a real screensaver. The -s flag runs it continuously and exits cleanly on any keypress, useful for an idle kiosk or demo terminal.
- Still actively maintained. Over 25 years after its 1999 release, it still builds cleanly on current Linux, macOS, and BSD systems.
Cons of cmatrix
- No computing function. It doesn't monitor, automate, or process anything, it's purely a visual effect by design.
- Can spike CPU usage. Low -u values redraw the screen fast enough to keep a full core busy, noticeable on a Raspberry Pi or older laptop.
- The -l font is console-only. The Linux console matrix.fnt look only renders correctly on an actual tty, not inside GNOME Terminal, iTerm2, or most emulators.
- No official Windows build. Running it on Windows means going through WSL or another POSIX compatibility layer first.
- Colors depend on your terminal. The same -C flag can render differently depending on your terminal emulator's TERM setting and color support.
- Blocks the terminal it's in. It occupies that window until you exit with Ctrl+C, or a keypress if launched with -s.
Install cmatrix in one line
Pick your platform. For most people, the official package manager route below is the right call; build from source only if you specifically want the latest commit from GitHub or your system has no cmatrix package at all.
Installs from the official Ubuntu/Debian repositories via APT. Dependencies (ncurses) are resolved automatically, and the package is signed and checked like any other system package.
Pros
- One command, no manual dependency handling
- Maintained and security-checked by the distro
- Clean removal later with sudo apt remove cmatrix
Cons
- Repo version can lag behind the latest GitHub release
- Version varies between Ubuntu/Debian releases
Fedora ships cmatrix directly in its default repositories, so DNF can install it without adding RPM Fusion or any third-party repo.
Pros
- No extra repositories needed
- Fast install, handled entirely by DNF
- Easy to remove with sudo dnf remove cmatrix
Cons
- Tied to Fedora's release cycle, so brand-new features arrive late
- Not pre-installed, so it still requires root access
Arch's rolling-release model means Pacman's cmatrix package tends to track upstream closely, so you get new releases sooner than on fixed-release distros.
Pros
- Usually the newest stable version available via a package manager
- Minimal, no bloated dependency chain
Cons
- Assumes you're already comfortable maintaining an Arch system
- Rolling updates can occasionally introduce breaking changes system-wide
Homebrew builds and installs cmatrix from its formula, pulling in ncurses if it isn't already present on your Mac.
Pros
- Simplest path for macOS, one command
- Homebrew tracks updates and handles clean uninstalls
Cons
- Requires Homebrew to already be installed
- First-time Homebrew setup on a fresh Mac takes a few extra minutes
Clones the official GitHub repository and compiles it locally with CMake. This is the only route that gives you the exact latest commit, and the only one that works if your system has no cmatrix package at all.
Pros
- Always the newest code, including unreleased fixes
- You can read and modify the source before installing
- Works even where no package exists for your OS
Cons
- Requires build tools: git, cmake, make, a C compiler
- No package manager to track or update it later
- More steps, more room for a misconfigured environment
Once installed, run it with just the command name:
Common flags
Combine flags to shape the effect. For the closest match to the movie, run cmatrix -lba.
| Flag | Effect |
|---|---|
| -a | Asynchronous scroll, columns fall at independent speeds |
| -b | Partial bold text mode |
| -B | All-bold text mode |
| -C [color] | Sets the character color, default is green |
| -l | Uses the Linux console matrix.fnt font |
| -o | Old-style scrolling, closer to the Windows/macOS screensaver |
| -s | Screensaver mode, exits on any keypress |
| -u [0-9] | Sets the update delay; lower numbers scroll faster |
Eight things worth knowing about cmatrix
Where it came from, how it works, how it stacks up against other terminal toys, and how to get more out of it.
The history of cmatrix: a late-night side project that outlived its era
cmatrix traces back to 1999, when developer Chris Allegretta built it as a compact side project inspired by the promotional screensaver that once accompanied The Matrix online. Written against the ncurses library, it was simple enough to put together quickly, yet flexible enough from its first version to support adjustable speed, bold text, and basic color.
Over the following two decades, maintenance passed through a small circle of contributors before settling into the actively maintained GitHub repository it lives in today. It never gained any practical computing purpose, and that was never the point. What kept it alive was timing: it captured a specific late-90s moment in film and internet culture well enough that installing it still reads as an inside joke every new generation of terminal users discovers on their own.
Filed under: history
How digital rain effects actually work under the hood
The trick behind cmatrix, and every clone of it, is simpler than it looks. Each column on screen holds a falling "head" character that gets redrawn one row lower on every tick, while the rows above it are gradually dimmed instead of erased. That fade is what gives the trailing streak its glow, rather than a hard-edged line of text dropping down the screen.
Two settings decide most of the personality of the effect. Synchronous mode moves every column in lockstep, which reads as more mechanical and closer to how the original film screensaver looked. Asynchronous mode, turned on with -a, lets each column pick its own pace, producing the busier, less uniform rain most people associate with the movie itself. Update delay controls how often the whole grid refreshes, and bold flags simply mix in heavier character weights along the trail for extra contrast.
Filed under: how it works
cmatrix flags, explained properly: a practical walkthrough
Most people run cmatrix once with no flags, watch it for ten seconds, and move on. The flags are where it gets more useful. If you want the closest match to the film's screensaver, cmatrix -lba combines the Linux console font, partial bold text, and asynchronous scrolling in one line, though the -l font only renders correctly on an actual Linux console rather than most terminal emulators.
For a calmer, more legible look on a desktop terminal, drop -l and pair -C with a color name and -u with a number from 0 to 9 to tune speed to taste, lower numbers fall faster. If you're setting cmatrix up as an idle-screen display on a shared machine, -s is the flag that matters most: it runs continuously and exits the moment someone presses a key, instead of requiring a deliberate Ctrl+C.
Filed under: usage
cmatrix vs other terminal eye candy: how it actually compares
cmatrix isn't the only "useless but fun" terminal program, just the most famous one. Asciiquarium swaps falling code for an animated ASCII fish tank, aimed squarely at charm rather than nostalgia. Hollywood takes a different angle entirely: instead of one effect, it fills a terminal with several panes of fake logs, progress bars, and hex dumps to simulate the exaggerated "hacking" scenes Hollywood films love, more parody than homage.
Closer to home is unimatrix, a Python reimplementation of the same digital rain idea with more flexibility around custom character sets and Unicode symbols, at the cost of needing a Python environment instead of a single compiled binary. If you specifically want the original film's look with minimal setup, cmatrix remains the simplest choice; if you want a wider character palette or plan to hack on the code yourself, unimatrix is worth a look.
Filed under: comparisons
Turning a spare Raspberry Pi into a matrix rain display
An old Raspberry Pi and a small secondhand monitor are enough to build a dedicated ambient display, and cmatrix is a natural fit for it since it needs almost no resources to run continuously. Install a lightweight Linux distribution, skip the desktop environment entirely, and set the Pi to boot straight to a console login.
From there, adding a single line to the shell's startup file that launches cmatrix -s after login turns the whole boot sequence into a one-purpose kiosk: power on, and the rain starts automatically, exiting cleanly with any keypress if you ever need the console back. Mounted in a repurposed picture frame or tucked into a bookshelf, it makes a genuinely low-cost piece of desk decor out of hardware that would otherwise sit in a drawer.
Filed under: projects
Why developers still bother with terminal toys in 2026
Programs like cmatrix have no business surviving this long in professional environments built around efficiency, yet they keep showing up in dotfiles repositories and fresh machine setups year after year. Part of the answer is that a terminal is one of the few remaining spaces developers fully control, down to the font and color of every character, and small joke-programs are an easy way to put a personal signature on that space.
The other part is simpler: software work is mentally demanding for long stretches, and a five-second glance at falling green text between tasks costs nothing while still functioning as a tiny, deliberate break. None of it makes anyone more productive in a measurable sense, and that's fine, it was never trying to.
Filed under: culture
Building a terminal setup you actually enjoy opening
cmatrix rarely lives alone in a serious terminal setup, it tends to sit alongside a handful of other small tools that together shape how a workspace feels. A system-info tool like neofetch or fastfetch prints a quick hardware summary next to some ASCII art on login, a custom prompt such as starship adds context like git branch and command status, and a Nerd Font fills in the icons those tools expect.
None of these pieces do much alone. Stacked together with a color scheme you actually chose on purpose, they turn a default black-and-white shell into something that feels considered, and cmatrix fits naturally into that stack as the purely decorative layer on top, called manually rather than run constantly.
Filed under: setup
Troubleshooting cmatrix: fixing the most common errors
Almost every cmatrix problem falls into one of three buckets. Building from source and seeing an error about a missing ncurses.h header means the development library isn't installed yet, on Debian-based systems sudo apt install libncurses5-dev resolves it before you re-run cmake.
If cmatrix runs but every character shows up in a single flat color regardless of the -C flag, the terminal's TERM environment variable usually isn't set to something that advertises color support, setting it to xterm-256color before launching fixes most cases. Garbled or missing characters specifically in -l mode almost always means you're running it inside a terminal emulator rather than a real Linux console, since that font mode only renders correctly on the console itself. And any "permission denied" during installation is simply a missing sudo in front of the package manager command.
Filed under: troubleshooting