liunx帮助
获取帮助的能力决定了技术的能力!
1、whatis
♢只显示命令的简短描述,相对功能比较单一。
[09:42:22 root@centos ~]#whatis rm
rm (1) - remove files or directories
rm (1p) - remove directory entries
1,1p:表示分类章节
♢使用数据库:whatis查看某个命令的列表依赖于数据库,这个数据库刚安装os时是没有的,是经过一段时间之后系统自动创建的但是自动创建时间不定,可以通过命令主动生成whatis依赖的数据库。[root@centos6 ~]# whatis rm rm: nothing appropriate
♢makewhatis | mandb制作数据库:
生成的方法centos6使用makewhatis生成,centos7使用mandb生成。[root@centos6 ~]# whatis cal cal: nothing appropriate [root@centos6 ~]# makewhatis [root@centos6 ~]# whatis cal cal (1) - displays a calendar cal (1p) - print a calendar
[root@centos7 ~]# whatis cal
cal: nothing appropriate.
[root@centos7 ~]# mandb
Processing manual pages under /usr/share/man...
Updating index cache for path `/usr/share/man/man7'. Wait...mandb: warning: /usr/share/man/man7/virkeycode-atset1.7.gz: whatis parse for virkeycode-atset1(7) failed
mandb: warning: /usr/share/man/man7/virkeycode-atset2.7.gz: whatis parse for virkeycode-atset2(7) failed
mandb: warning: /usr/share/man/man7/virkeycode-atset3.7.gz: whatis parse for virkeycode-atset3(7) failed
mandb: warning: /usr/share/man/man7/virkeycode-linux.7.gz: whatis parse for virkeycode-linux(7) failed
mandb: warning: /usr/share/man/man7/virkeycode-osx.7.gz: whatis parse for virkeycode-osx(7) failed
mandb: warning: /usr/share/man/man7/virkeyname-win32.7.gz: whatis parse for virkeyname-win32(7) failed
mandb: warning: /usr/share/man/man7/virkeycode-qnum.7.gz: whatis parse for virkeycode-qnum(7) failed
mandb: warning: /usr/share/man/man7/virkeycode-usb.7.gz: whatis parse for virkeycode-usb(7) failed
mandb: warning: /usr/share/man/man7/virkeycode-win32.7.gz: whatis parse for virkeycode-win32(7) failed
mandb: warning: /usr/share/man/man7/virkeycode-xtkbd.7.gz: whatis parse for virkeycode-xtkbd(7) failed
mandb: warning: /usr/share/man/man7/virkeyname-linux.7.gz: whatis parse for virkeyname-linux(7) failed
mandb: warning: /usr/share/man/man7/virkeyname-osx.7.gz: whatis parse for virkeyname-osx(7) failed
Updating index cache for path `/usr/share/man/man8'. Wait...mandb: warning: /usr/share/man/man8/fsck.fat.8.manpage-fix.gz: ignoring bogus filename
Updating index cache for path `/usr/share/man/man3'. Wait...mandb: can't open /usr/share/man/man3/man3/wl_display_connect.3: No such file or directory
mandb: warning: /usr/share/man/man3/wl_display_connect_to_fd.3.gz: bad symlink or ROFF `.so' request
Updating index cache for path `/usr/share/man/man4'. Wait...mandb: can't open /usr/share/man/man/man4/crontabs.4: No such file or directory
mandb: warning: /usr/share/man/man4/run-parts.4.gz: bad symlink or ROFF `.so' request
Updating index cache for path `/usr/share/man/mann'. Wait...done.
Checking for stray cats under /usr/share/man...
Checking for stray cats under /var/cache/man...
Processing manual pages under /usr/share/man/uk...
Updating index cache for path `/usr/share/man/uk/man1'. Wait...done.
Checking for stray cats under /usr/share/man/uk...
Checking for stray cats under /var/cache/man/uk...
Processing manual pages under /usr/share/man/hu...
Updating index cache for path `/usr/share/man/hu/man8'. Wait...done.
Checking for stray cats under /usr/share/man/hu...
Checking for stray cats under /var/cache/man/hu...
Processing manual pages under /usr/share/man/de...
Updating index cache for path `/usr/share/man/de/man5'. Wait...done.
Checking for stray cats under /usr/share/man/de...
Checking for stray cats under /var/cache/man/de...
Processing manual pages under /usr/share/man/ja...
Updating index cache for path `/usr/share/man/ja/man1'. Wait...mandb: warning: /usr/share/man/ja/man1/evim.1.gz: whatis parse for evim(1) failed
mandb: warning: /usr/share/man/ja/man1/vim.1.gz: whatis parse for ex(1) failed
mandb: warning: /usr/share/man/ja/man1/vim.1.gz: whatis parse for rview(1) failed
mandb: warning: /usr/share/man/ja/man1/vim.1.gz: whatis parse for rvim(1) failed
mandb: warning: /usr/share/man/ja/man1/vim.1.gz: whatis parse for view(1) failed
mandb: warning: /usr/share/man/ja/man1/vim.1.gz: whatis parse for vim(1) failed
mandb: warning: /usr/share/man/ja/man1/vimdiff.1.gz: whatis parse for vimdiff(1) failed
mandb: warning: /usr/share/man/ja/man1/vimtutor.1.gz: whatis parse for vimtutor(1) failed
mandb: warning: /usr/share/man/ja/man1/xxd.1.gz: whatis parse for xxd(1) failed
Updating index cache for path `/usr/share/man/ja/man5'. Wait...done.
Checking for stray cats under /usr/share/man/ja...
Checking for stray cats under /var/cache/man/ja...
Processing manual pages under /usr/share/man/fr...
Updating index cache for path `/usr/share/man/fr/man5'. Wait...done.
Checking for stray cats under /usr/share/man/fr...
Checking for stray cats under /var/cache/man/fr...
Processing manual pages under /usr/share/man/ko...
Updating index cache for path `/usr/share/man/ko/man8'. Wait...done.
Checking for stray cats under /usr/share/man/ko...
Checking for stray cats under /var/cache/man/ko...
Processing manual pages under /usr/share/man/pl...
Updating index cache for path `/usr/share/man/pl/man5'. Wait...done.
Checking for stray cats under /usr/share/man/pl...
Checking for stray cats under /var/cache/man/pl...
Processing manual pages under /usr/share/man/ru...
Updating index cache for path `/usr/share/man/ru/man5'. Wait...done.
Checking for stray cats under /usr/share/man/ru...
Checking for stray cats under /var/cache/man/ru...
Processing manual pages under /usr/share/man/sk...
Updating index cache for path `/usr/share/man/sk/man8'. Wait...done.
Checking for stray cats under /usr/share/man/sk...
Checking for stray cats under /var/cache/man/sk...
Processing manual pages under /usr/share/man/cs...
Updating index cache for path `/usr/share/man/cs/man7'. Wait...done.
Checking for stray cats under /usr/share/man/cs...
Checking for stray cats under /var/cache/man/cs...
Processing manual pages under /usr/share/man/da...
Updating index cache for path `/usr/share/man/da/man8'. Wait...done.
Checking for stray cats under /usr/share/man/da...
Checking for stray cats under /var/cache/man/da...
Processing manual pages under /usr/share/man/id...
Updating index cache for path `/usr/share/man/id/man5'. Wait...done.
Checking for stray cats under /usr/share/man/id...
Checking for stray cats under /var/cache/man/id...
Processing manual pages under /usr/share/man/it...
Updating index cache for path `/usr/share/man/it/man8'. Wait...done.
Checking for stray cats under /usr/share/man/it...
Checking for stray cats under /var/cache/man/it...
Processing manual pages under /usr/share/man/pt_BR...
Updating index cache for path `/usr/share/man/pt_BR/man8'. Wait...done.
Checking for stray cats under /usr/share/man/pt_BR...
Checking for stray cats under /var/cache/man/pt_BR...
Processing manual pages under /usr/share/man/sv...
Updating index cache for path `/usr/share/man/sv/man8'. Wait...done.
Checking for stray cats under /usr/share/man/sv...
Checking for stray cats under /var/cache/man/sv...
Processing manual pages under /usr/share/man/tr...
Updating index cache for path `/usr/share/man/tr/man8'. Wait...done.
Checking for stray cats under /usr/share/man/tr...
Checking for stray cats under /var/cache/man/tr...
Processing manual pages under /usr/share/man/zh_CN...
Updating index cache for path `/usr/share/man/zh_CN/man8'. Wait...done.
Checking for stray cats under /usr/share/man/zh_CN...
Checking for stray cats under /var/cache/man/zh_CN...
Processing manual pages under /usr/share/man/zh_TW...
Updating index cache for path `/usr/share/man/zh_TW/man8'. Wait...done.
Checking for stray cats under /usr/share/man/zh_TW...
Checking for stray cats under /var/cache/man/zh_TW...
Processing manual pages under /usr/share/man/ca...
Updating index cache for path `/usr/share/man/ca/man5'. Wait...done.
Checking for stray cats under /usr/share/man/ca...
Checking for stray cats under /var/cache/man/ca...
Processing manual pages under /usr/share/man/es...
Updating index cache for path `/usr/share/man/es/man8'. Wait...done.
Checking for stray cats under /usr/share/man/es...
Checking for stray cats under /var/cache/man/es...
Processing manual pages under /usr/share/man/nl...
Updating index cache for path `/usr/share/man/nl/man8'. Wait...done.
Checking for stray cats under /usr/share/man/nl...
Checking for stray cats under /var/cache/man/nl...
Processing manual pages under /usr/share/man/pt...
Updating index cache for path `/usr/share/man/pt/man8'. Wait...done.
Checking for stray cats under /usr/share/man/pt...
Checking for stray cats under /var/cache/man/pt...
Processing manual pages under /usr/share/man/overrides...
Updating index cache for path `/usr/share/man/overrides/man8'. Wait...done.
Checking for stray cats under /usr/share/man/overrides...
Checking for stray cats under /var/cache/man/overrides...
Processing manual pages under /usr/share/man/en...
Updating index cache for path `/usr/share/man/en/man7'. Wait...done.
Checking for stray cats under /usr/share/man/en...
Checking for stray cats under /var/cache/man/en...
Processing manual pages under /usr/local/share/man...
Updating index cache for path `/usr/local/share/man/mann'. Wait...done.
Checking for stray cats under /usr/local/share/man...
Checking for stray cats under /var/cache/man/local...
120 man subdirectories contained newer manual pages.
11881 manual pages were added.
0 stray cats were added.
0 old database entries were purged.
[root@centos7 ~]# whatis cal
cal (1) - display a calendar
cal (1p) - print a calendar
不知道什么原因centos6没显示生成过程。
♢使用示例:
whatis cal 或 man –f cal 效果相同。
[root@centos7 ~]# whatis cal
cal (1) - display a calendar
cal (1p) - print a calendar
[root@centos7 ~]# man -f cal
cal (1) - display a calendar
cal (1p) - print a calendar