Ubuntu 26.04环境中如何使用中文man手册以及man手册默认中文显示

最近,我在使用Ubuntu 26.04的环境,经常使用命令行的方式操作一些不常用的系统自带软件例如,mkdir、lsblk、df等等,现在就有一个问题,Ubuntu 26.04自带的man手册是英文的看起来不方便,有没有更好的呢?例如中文man手册。

我问了一下AI,并操作了一下,发现的确可行,现在记录下来。

第一步:

安装中文 man 手册

bash 复制代码
sudo apt update
sudo apt install manpages-zh

第二步:

推荐用法:保留英文 man,新增 cman

bash 复制代码
nano ~/.bashrc

在默认新增:

bash 复制代码
alias cman='man -M /usr/share/man/zh_CN'

第三步:生效配置:

bash 复制代码
source ~/.bashrc

之后:

bash 复制代码
cman ls
cman fdisk

不过值得注意的是cman手册的内容不全,并不是所有命令的中文man手册解释都有的。

如果想让 man 默认显示中文(我尝试了一下,可行)

可以在 ~/.bashrc 里加:

bash 复制代码
export LANG=zh_CN.UTF-8

然后,使配置生效:

bash 复制代码
source ~/.bashrc

引伸:

man手册内容比较多,有一种比较简查询命令"cheat"便的,具体安装方式如下:需要用到snap命令。这也是为什么查询apt-get 以及dpkg命令无法找到原因。

bash 复制代码
apt list --installed
# 或者
apt-mark showmannul
# 或者
dpkg -l

安装方式:

bash 复制代码
snap install cheat

使用方式:

bash 复制代码
cheat ls
# 显示如下:
# To display everything in <dir>, excluding hidden files:
ls <dir>

# To display everything in <dir>, including hidden files:
ls -a <dir>

# To display all files, along with the size (with unit suffixes) and timestamp:
ls -lh <dir>

# To display files, sorted by size:
ls -S <dir>

# To display directories only:
ls -d */ <dir>

# To display directories only, include hidden:
ls -d .*/ */ <dir>

# To display all files sorted by changed date, most recent first:
ls -ltc 

# To display files sorted by create time:
ls -lt

# To display files in a single column:
ls -1

# To show ACLs (MacOS):
# see also `cheat chmod` for `/bin/chmod` options for ACLs
/bin/ls -le

# To show all the subtree files (Recursive Mode):
ls -R
相关推荐
承渊政道1 天前
Linux网络学习【深入理解多路转接select、poll的代码改写】
linux·ubuntu·select·多路转接·poll
沫璃染墨2 天前
从零入门计算机网络系列(十二):HTTP长连接与会话管理详解——从Connection到Cookie与Session
linux·服务器·c++·tcp/ip·ubuntu·http·交互
longzhizhui9262 天前
Ubuntu 全版本 CVE-2026-98432 内核安全升级操作手册
ubuntu·网络安全·云计算·bash
OPEN-F2 天前
Ubuntu 自动登录后 GNOME 远程桌面连不上?一次登录钥匙环锁定的排查与永久修复
linux·运维·ubuntu
A7bert7772 天前
【MobileSAM部署至RK3588】环境适配→转换RKNN→开发板部署
c++·人工智能·深度学习·目标检测·ubuntu
用户4107192013253 天前
用 systemd 从零做一个系统健康巡检服务:脚本、沙箱与磁盘满排查实战
linux·ubuntu
Linux-lucky3 天前
46-Linux学习之旅之LVS负载均衡与keepalived高可用
linux·运维·学习·ubuntu·负载均衡·lvs
wzg20163 天前
ubuntu通过docker镜像部署安装onlyoffice
linux·ubuntu·docker
Sw1zzle3 天前
Go入门(零):Linux Ubuntu 22.04 安装 Go
linux·ubuntu·golang
时空无限3 天前
ubuntu 26.04 sudo 连不上主机卡住然后失败问题处理
linux·服务器·ubuntu