whatis
基于数据库的查找,查找内容比较慢 优点:查找速度快 缺点:没有实时性[root@localhost ~]# whatis lsls (1) - list directory contentsls (1p) - list directory contents
数据库文件
Centos6:/var/cache/man/whatis
Centos7:/var/cache/man/index.db 更新数据库文件 Centos6:makewhatis Centos7:mandbhelp
help是一个内部命令,help命令只能显示shell内部的命令帮助信息。而对于外部命令的帮助信息只能使用man或者info命令查看
[root@localhost ~]# type helphelp is a shell builtin
help cd //查看cd的帮助
[root@localhost ~]# help cdcd: cd [-L|[-P [-e]]] [dir] Change the shell working directory. Change the current directory to DIR. The default DIR is the value of the HOME shell variable. The variable CDPATH defines the search path for the directory containing DIR. Alternative directory names in CDPATH are separated by a colon (:). A null directory name is the same as the current directory. If DIR begins with a slash (/), then CDPATH is not used. If the directory is not found, and the shell option `cdable_vars' is set, the word is assumed to be a variable name. If that variable has a value, its value is used for DIR. Options: -L force symbolic links to be followed -P use the physical directory structure without following symbolic links -e if the -P option is supplied, and the current working directory cannot be determined successfully, exit with a non-zero status The default is to follow symbolic links, as if `-L' were specified. Exit Status: Returns 0 if the directory is changed, and if $PWD is set successfully when -P is used; non-zero otherwise. help pwd help enable ls --help
man
中文man使用方法:
1. 挂载光盘 mount /dev/cdrom /media/ 2. 安装中文man的软件包 rpm -ivh /media/Packages/man-pages-zh-CN-1.5.2-4.el7.noarch.rpm[root@localhost ~]# mount /dev/cdrom /media/mount: /dev/sr0 is write-protected, mounting read-only[root@localhost ~]# rpm -ivh /media/Packages/screen-4.1.0-0.25.20120314git3c2946.el7.x86_64.rpm warning: /media/Packages/screen-4.1.0-0.25.20120314git3c2946.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEYPreparing... ################################# [100%]Updating / installing... 1:screen-4.1.0-0.25.20120314git3c29################################# [100%
3. 将中文man的路径写的man的配置文件
gedit /etc/man_db.conf 增加一行,内容如下
MANDATORY_MANPATH /usr/share/man/zh_CN 4.man -a ls 查看ls[root@localhost ~]# man -a ls LS(1) User Commands LS(1)NAME ls - list directory contentsSYNOPSIS ls [OPTION]... [FILE]...DESCRIPTION List information about the FILEs (the current directory by default). Sort entries alphabeti‐ cally if none of -cftuvSUX nor --sort is speci‐ fied.
q退出man命令
man的使用
f向下翻一页 b向上翻一页 d向下翻半页 u向上翻半页 ** G 跳至尾页 ** g 跳至首页 ** 搜索关键字 /关键字 n 向下 N向上 ?关键字 n 向上 q 退出manman的章节,man的关键字有多个文件与之匹配,则按类型,划分为以下9个章节
* 1 Executable programs or shell commands 2 System calls (functions provided by the kernel) 3 Library calls (functions within program libraries) 4 Special files (usually found in /dev) * 5 File formats and conventions eg /etc/passwd 6 Games 7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7) * 8 System administration commands (usually only for root) 9 Kernel routines [Non standard]man 章节号 关键字 (若省略章节号,则显示数字较小的章节)
man -a 关键字 依次查看指定关键字的所有章节
[root@localhost ~]# man -a issue ISSUE(5) Linux Programmer's Manual ISSUE(5)NAME issue - prelogin message and identification fileDESCRIPTION The file /etc/issue is a text file which con‐ tains a message or system identification to be printed before the login prompt. It may con‐ tain various @char and \char sequences, if sup‐ ported by the getty-type program employed on the system.FILES /etc/issueSEE ALSO motd(5), agetty(8), mingetty(8)
man -w 关键字 查看关键字匹配到的第一个章节的来源文件
man -aw 关键字 查看关键字匹配到的所有章节的来源文件 man -f 关键字 等于 whatis 关键字