cmatrix(就是那个模拟《黑客帝国》数字雨效果的终端程序)在 CentOS 上是兼容的,而且使用非常普遍。
下面给你几个常见情况和方法:
CentOS 默认仓库里一般没有 cmatrix,但 EPEL 源里有。
# CentOS 7
yum install epel-release -y
yum install cmatrix -y
# CentOS 8 / Stream
dnf install epel-release -y
dnf install cmatrix -y
安装完成后直接运行:
cmatrix
yum install ncurses-devel gcc make -y
wget https://github.com/abishekvashok/cmatrix/releases/download/v2.0/cmatrix-v2.0-Butterscotch.tar.gz
tar -xzf cmatrix-v2.0-Butterscotch.tar.gz
cd cmatrix
./configure
make
make install
运行:
cmatrix
| 项目 | 情况 |
|---|---|
| CentOS 7 | ✅ 完全兼容 |
| CentOS 8 | ✅ 完全兼容 |
| CentOS Stream | ✅ 完全兼容 |
| 本地终端 | ✅ |
| SSH 远程终端 | ✅(推荐用 Xshell / iTerm / Terminal) |
| 图形界面 | 不需要 |
⚠️ 注意:
- 必须在 支持 ANSI 颜色的终端 中运行
- 不支持极老的单色终端(如某些裸 tty)
cmatrix -b # 加粗字符
cmatrix -C red # 红色雨
cmatrix -s # 屏保模式(按任意键退出)
Q:运行后乱码?
A:终端编码改成 UTF-8,或更换支持 UTF-8 的终端。
Q:SSH 登录后没效果?
A:确认 TERM=xterm-256color 或 xterm
如果你告诉我 CentOS 具体版本(7 / 8 / Stream),我可以给你更精确的命令。