liunx下的帮助
在liunx下获得帮助命令有 whatis,help,和man。运用最多 内容最丰富的就是慢man。
一:whatis:基于数据库的查找,查找速度快,但是没有实时性。
数据库文件
Centos6:/var/cache/man/whatis
Centos7:/var/cache/man/index.db
更新数据库文件
Centos6:makewhatis
Centos7:mandb
二:help
help命令在查看内部命令是 格式为 help command 例如:
help cd
help pwd
help enable
外部命令时为 command --help例如
ls --help
三 :man
要想使用中文man(默认英文),需要先安装man,在linux下安装命令如下:
1.挂载光盘
mount /dev/cdrom /media/
2.安装中文man的软件包
rpm -ivh /media/Packages/man-pages-zh-CN-1.5.2-4.el7.noarch.rpm
3.将中文man的路径写的man的配置文件
gedit /etc/man_db.conf 增加一行,内容如下
MANDATORY_MANPATH /usr/share/man/zh_CN
4.man -a ls(使用时加上-a显示中文版,默认英文要想q退出,然后空格显示中文)。
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 关键字 依次查看指定关键字的所有章节
man -w 关键字 查看关键字匹配到的第一个章节的来源文件
man -aw 关键字 查看关键字匹配到的所有章节的来源文件
man -f 关键字 等于 whatis 关键字