Linux/Unix desktop fun: Simulates the display from “The Matrix”

The Matrix is a science fiction action movie from 1999. It was written and directed by the Wachowski Brothers. The film has falling green characters on screen. The digital rain is representing the activity of the virtual reality in “The Matrix.” You can now have Matrix digital rain with CMatrix on a Linux or Unix terminal too.

apt-get command/apt command on a Debian/Ubuntu/Mint Linux:
$ sudo apt install cmatrix
Outputs from my Ubuntu desktop:

[sudo] password for vivek: Reading package lists... Done
Building dependency tree Reading state information... Done
Suggested packages: cmatrix-xfont
The following NEW packages will be installed: cmatrix
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.8 kB of archives.
After this operation, 50.2 kB of additional disk space will be used.
Get:1 artful/universe amd64 cmatrix amd64 1.2a-5build2 [15.8 kB]
Fetched 15.8 kB in 0s (19.7 kB/s)
Selecting previously unselected package cmatrix.
(Reading database ... 205388 files and directories currently installed.)
Preparing to unpack .../cmatrix_1.2a-5build2_amd64.deb ...
Unpacking cmatrix (1.2a-5build2) ...
Setting up cmatrix (1.2a-5build2) ...
Processing triggers for man-db ( ...

Installing cmatrix on an Arch Linux

Execute the following pacman command:
$ sudo pacman -S cmatrix

FreeBSD install cmatrix

To install the port run:
# cd /usr/ports/misc/cmatrix/ && make install clean
OR add the binary package using the pkg command
# pkg install cmatrix

macOS Unix desktop install cmatrix

First, install Homebrew on macOS and then type the following brew command:
$ brew install cmatrix

OpenBSD install cmatrix using the pkg_add

Run the following pkg_add command:
# pkg_add cmatrix

Fedora Linux installation

Try the following dnf command:
$ sudo dnf install cmatrix

Alpine Linux install cmatrix

Use the following apk command:
$ sudo apk add cmatrix

(1/1) Installing cmatrix (2.0-r0)
Executing busybox-1.31.1-r19.trigger
OK: 16 MiB in 29 packages

Using cmatrix

Simply type the following command at your shell prompt:
$ cmatrix

cmtarix in action Simulates the display from The Matrix

cmtarix in action

Using keyboard

The following keystrokes are available during execution (unavailable in -s mode):

KEYSTROKES Description
a Toggle asynchronous scroll
b Random bold characters
B All bold characters
n Turn off bold characters
0-9 Adjust update speed
! @ # $ % ^ & ) Change the color of the matrix to the corresponding color: ! – red, @ – green, # – yellow, $ – blue, % – magenta, ^ – cyan, & – white, ) – black.
q Quit the program

You can pass the following option to the cmatrix command:
$ cmatrix -h
Here is what we see:

 -a: Asynchronous scroll -b: Bold characters on -B: All bold characters (overrides -b) -c: Use Japanese characters as seen in the original matrix. Requires appropriate fonts -f: Force the linux $TERM type to be on -l: Linux mode (uses matrix console font) -L: Lock mode (can be closed from another terminal) -o: Use old-style scrolling -h: Print usage and exit -n: No bold characters (overrides -b and -B, default) -s: "Screensaver" mode, exits on first keystroke -x: X window mode, use if your xterm is using mtx.pcf -V: Print version information and exit -u delay (0 - 10, default 4): Screen update delay -C [color]: Use this color for matrix (default green) -r: rainbow mode -m: lambda mode


You now have the coolest terminal app! Grab the source code here.

Posted by Contributor