whatis
基于数据库的查找,查找内容比较慢
优点:查找速度快
缺点:没有实时性
[root@localhost ~]# whatis ls ls (1) - list directory contents ls (1p) - list directory contents
数据库文件
Centos6:/var/cache/man/whatis
Centos7:/var/cache/man/index.db
更新数据库文件
Centos6:makewhatis
Centos7:mandb
help
help是一个内部命令,help命令只能显示shell内部的命令帮助信息。而对于外部命令的帮助信息只能使用man或者info命令查看
[root@localhost ~]# type help help is a shell builtin
help cd //查看cd的帮助
[root@localhost ~]# help cd cd: cd [-L|[-P [-e]]] [dir]Change the shell working directory.Change the current directory to DIR. The default DIR is the value of theHOME shell variable.The variable CDPATH defines the search path for the directory containingDIR. Alternative directory names in CDPATH are separated by a colon (:).A null directory name is the same as the current directory. If DIR beginswith 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 symboliclinks-e if the -P option is supplied, and the current working directorycannot be determined successfully, exit with a non-zero statusThe 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 pwdhelp enablels --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: NOKEY Preparing... ################################# [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) NAMEls - list directory contents SYNOPSISls [OPTION]... [FILE]... DESCRIPTIONList information about the FILEs (the currentdirectory 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 退出man
man的章节,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) NAMEissue - prelogin message and identificationfile DESCRIPTIONThe file /etc/issue is a text file which con‐tains a message or system identification to beprinted before the login prompt. It may con‐tain various @char and \char sequences, if sup‐ported by the getty-type program employed onthe system. FILES/etc/issue SEE ALSOmotd(5), agetty(8), mingetty(8)
man -w 关键字 查看关键字匹配到的第一个章节的来源文件
man -aw 关键字 查看关键字匹配到的所有章节的来源文件
man -f 关键字 等于 whatis 关键字