资讯动态

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

发布时间:2026/10/18 14:19:55 来源:尧图企业网站定制
最近我在使用Ubuntu 26.04的环境经常使用命令行的方式操作一些不常用的系统自带软件例如mkdir、lsblk、df等等现在就有一个问题Ubuntu 26.04自带的man手册是英文的看起来不方便有没有更好的呢例如中文man手册。我问了一下AI并操作了一下发现的确可行现在记录下来。第一步安装中文 man 手册sudo apt update sudo apt install manpages-zh第二步推荐用法保留英文 man新增 cmannano ~/.bashrc在默认新增alias cmanman -M /usr/share/man/zh_CN第三步生效配置source ~/.bashrc之后cman ls cman fdisk不过值得注意的是cman手册的内容不全并不是所有命令的中文man手册解释都有的。如果想让 man 默认显示中文我尝试了一下可行可以在~/.bashrc里加export LANGzh_CN.UTF-8然后使配置生效source ~/.bashrc引伸man手册内容比较多有一种比较简查询命令“cheat”便的具体安装方式如下需要用到snap命令。这也是为什么查询apt-get 以及dpkg命令无法找到原因。apt list --installed # 或者 apt-mark showmannul # 或者 dpkg -l安装方式snap install cheat使用方式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

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价 →
↑