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

01-03 18:25

T he 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.

Install cmatrix

Install and setup CMatrix as per your Linux/Unix version.

How to install cmatrix on a Debian/Ubuntu Linux

Type the followingapt-get command/apt command on a Debian/Ubuntu/Mint Linux:

$ sudo apt install cmatrix

Sample outputs:

[sudo] password for vivek: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
The following NEW packages will be installed:
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 ( ...

How to install cmatrix on an Arch Linux

Type the following pacman command:

$ sudo pacman -S cmatrix

How to install cmatrix on a FreeBSD system

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

How to install cmatrix on a macOS Unix

Type the following brew command:

$ brew install cmatrix

How to install cmatrix on a OpenBSD

Type the following pkg_add command:

# pkg_add cmatrix

Using cmatrix

Simply type the command:

$ cmatrix

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

Sample outputs:

-a: Asynchronous scroll
 -b: Bold characters on
 -B: All bold characters (overrides -b)
 -f: Force the linux $TERM type to be on
 -l: Linux mode (uses matrix console font)
 -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)

You now have the coolest terminal app!

This entry is 4 of 8 in the Linux and Unix Desktop Fun Tutorial series. Keep reading the rest of the series:
  1. Christmas Tree For Your Terminal
  2. Cat And Mouse Chase All Over Your Screen
  3. Bastet Tetris(r) clone with block-choosing AI for console
  4. The Digital Rain: Simulates the display from "The Matrix"
  5. Summon Swarms Of Penguins To Waddle About The Desktop
  6. Run Steam Locomotive On Your Desktop
  7. Let it Snow On Your Desktop
  8. Text Mode Box and Comment Drawing

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter , Facebook , Google+ .

标签: Linux Unix 矩阵
© 2014 TuiCode, Inc.