温馨提示×

centos cmatrix怎么截图保存

小樊
40
2026-10-17 16:12:34
栏目: 智能运维

在 CentOS 上用 cmatrix(那个“黑客帝国”字符雨)截图并保存,常见有几种方式,看你用的是纯终端还是桌面环境。


一、桌面环境(GNOME / KDE 等,有 X11/Wayland)

方法 1:用系统截图工具(最简单)

  1. 打开终端,运行:
    cmatrix
    
  2. 使用系统截图快捷键:
    • GNOME:PrintScreen(全屏)或 Shift + PrintScreen(区域)
    • KDE:Spectacle
  3. 保存为 PNG 即可

方法 2:用 gnome-screenshot

gnome-screenshot -w   # 截取当前窗口
gnome-screenshot       # 全屏

保存路径默认在 ~/Pictures


二、纯终端 / SSH(无图形界面)

方法 1:用 script 记录字符(不是图片)

script -q -c "cmatrix" output.txt

这只是文本记录,不是图片。


方法 2:用 tmux + 截图(推荐)

tmux
cmatrix
# 按 Ctrl+B 再 :
capture-pane -p > cmatrix.txt

方法 3:用 fbcat(帧缓冲截图,真·终端)

如果你是 tty 控制台(不是 X):

sudo yum install fbcat
cmatrix
sudo fbcat > cmatrix.png

⚠️ 需要 framebuffer 支持


三、把终端内容转成图片(进阶)

sudo yum install imagemagick
cmatrix > cmatrix.txt
# 用 ansi 转图片工具(如 ansi2image,需要 Python)

四、推荐方案总结

场景 推荐方式
有桌面 gnome-screenshot
SSH 录屏 / 文本
纯 tty fbcat

如果你告诉我:

  • 是 SSH 还是 本地
  • 有没有 桌面环境

我可以给你更精确的一条命令。

0 踩