Lesson 106: cmatrix Command
In this lesson, you'll learn how to use the cmatrix command to display the iconic cascading green character rain from the Matrix movie directly in your Linux terminal and how to customize the colors, speed, font style, and behavior to make it your own.
The cmatrix command renders a real-time animation of randomly falling characters across your terminal screen, inspired by the digital rain visual from the 1999 film The Matrix.
It uses the ncurses library to draw directly to the terminal buffer, which means it works in any terminal emulator, over SSH, and even on a bare console without a graphical desktop.
Beyond the obvious novelty, cmatrix is genuinely useful for hiding your screen contents in a visually striking way when stepping away from your desk, for screensaver setups on terminal-only systems, and for impressing people who associate the green rain with serious hacking, which in Linux circles has been a tradition since the early 2000s.
Installation
sudo apt install cmatrix # Debian/Ubuntu/Mint
Or:
sudo dnf install cmatrix # Fedora/RHEL 9+
Or:
sudo yum install cmatrix # RHEL/CentOS 7/8
Or:
sudo pacman -S cmatrix # Arch Linux
Or:
sudo apk add cmatrix # Alpine Linux
Or:
sudo zypper install cmatrix # OpenSUSE
Or:
sudo emerge -a sys-apps/cmatrix # Gentoo Linux
Syntax
cmatrix [OPTIONS]
Press q or Ctrl+C to exit at any time.
Options
| Option | Description |
|---|---|
-a |
Asynchronous scroll β columns fall at independent random speeds |
-b |
Bold characters β brighter, higher-contrast display |
-B |
All characters bold (maximum brightness) |
-f |
Force the IBM PC font (requires a compatible terminal) |
-l |
Linux console font mode β use for bare TTY sessions |
-o |
Use the old-style scrolling mode |
-n |
No bold characters β uniform brightness |
-s |
"Screensaver" mode β exit on any keypress |
-x |
X window mode β use with X11 terminals |
-V |
Display version information and exit |
-u <speed> |
Set scroll speed from 0 (fastest) to 9 (slowest) |
-C <color> |
Set the character color |
Available colors for -C:
green (default), red, blue, white, yellow, cyan, magenta, black
1. Run the Classic Matrix Rain
cmatrix
This launches the full-screen green character rain with default settings - random character columns falling at varying speeds on a black background, exactly as most people picture the Matrix aesthetic.
Press q to exit cleanly.
2. Enable Bold Characters for Higher Contrast
cmatrix -b
The -b flag enables bold characters, making the falling text brighter and sharper - particularly noticeable on terminals with lower contrast or brightness settings.
Some terminals render bold as a slightly different color shade rather than pure brightness.
For maximum brightness with all characters bold: