Linux之man命令详解及中文汉化

使用方法

Linux man中的man就是manual的缩写,用来查看系统中自带的各种参考手册

使用方法:

man command

示例:

[root@VM_0_13_centos ~]# man ls
LS(1)                                                                                  User Commands                                                                                 LS(1)

NAME
       ls - list directory contents

SYNOPSIS
       ls [OPTION]... [FILE]...

DESCRIPTION
       List information about the FILEs (the current directory by default).  Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.

       Mandatory arguments to long options are mandatory for short options too.

       -a, --all
              do not ignore entries starting with .

       -A, --almost-all
              do not list implied . and ..

       --author
              with -l, print the author of each file

       -b, --escape
              print C-style escapes for nongraphic characters

       --block-size=SIZE
              scale sizes by SIZE before printing them; e.g., '--block-size=M' prints sizes in units of 1,048,576 bytes; see SIZE format below

       -B, --ignore-backups
              do not list implied entries ending with ~

       -c     with -lt: sort by, and show, ctime (time of last modification of file status information); with -l: show ctime and sort by name; otherwise: sort by ctime, newest first

常用参数:

大写N:向上查找
小写n:向下查找
/或?:查找内容
q:退出

也可以使用以下命令更详细

info command

安装中文版man

英文不好?没关系,往下看!!!

原官方下载地址

Githu项目地址

安装方法一

1、Debian / Ubuntu安装

sudo apt update
sudo apt install manpages-zh

2、Arch Linux:

pacman -Syu
pacman -S man-pages-zh_cn man-pages-zh_tw

3、Red Hat / CentOS:

yum update
yum install man-pages-zh-CN

4、Fedora:

dnf update
dnf install man-pages-zh-CN

安装方法二

源码网址 https://src.fedoraproject.org/repo/pkgs/man-pages-zh-CN/

1、获取安装包

[root@localhost opt]# wget  https://src.fedoraproject.org/repo/pkgs/man-pages-zh-CN/manpages-zh-1.5.1.tar.gz/13275fd039de8788b15151c896150bc4/manpages-zh-1.5.1.tar.gz

2、解压并安装(最好使用root)

[root@localhost opt]# tar xf manpages-zh-1.5.1.tar.gz
[root@localhost opt]# cd manpages-zh-1.5.1/
[root@localhost manpages-zh-1.5.1]# ./configure --disable-zhtw  --prefix=/usr/local/zhman
[root@localhost manpages-zh-1.5.1]# make && make install

3、 为了不覆盖man,我们新建cman命令作为中文查询

[root@localhost man1]# cd ~
[root@localhost ~]# echo "alias cman='man -M /usr/local/zhman/share/man/zh_CN' " >>.bash_profile
[root@localhost ~]# source .bash_profile

4.使用我们新建的中文cman查询命令

[root@localhost ~]# cman ls

执行结果:

到此就完成了常用的命令都可以

  • 33
    点赞
  • 92
    收藏
    觉得还不错? 一键收藏
  • 9
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值