Linux中whatis与makewhatis的作用


在好久没有和大家分享 Linux 命令方面的东东了,Linux 是一个以命令操作为主的系统,众多的命令与其作用,要想都记住也不太现实。因此,用 man info whatis 等工具来查看命令的作用就很重要了。 Linux 中的 whatis 命令可以从它的字面意思可以看出来,就是“这是什么”,通过它可以知道某命令是用来干什么的,而且是用很简短的方式来描述。

如果你是 RHEL 6 的最小化安装,就没有包含 man whatis 命令,你需要安装 man 。whatis 可能大家会比较熟悉,但是 makewhatis 呢?其实 whatis 运行的结果是需要把命令的情况检索到它的数据库中的。对于还没有这个数据库的系统,就需要用 makewhatis 命令来让系统立即检索。否则系统将在一定的时候自动检索。通过下面的命令运行的实例,大家就应该比较清楚地了解到这一点了。

[root@OwnLinux-server media]# whatis whatis
whatis: nothing appropriate
[root@OwnLinux-server media]# whatis makewhatis
makewhatis: nothing appropriate
[root@OwnLinux-server media]# whatis ls
ls: nothing appropriate
[root@OwnLinux-server media]# makewhatis
[root@OwnLinux-server media]# whatis whatis
whatis (1) – search the whatis database for complete words
[root@OwnLinux-server media]# whatis makewhatis
makewhatis (8) – Create the whatis database

原文连接:http://www.ownlinux.cn/2011/04/01/linux-whatis-makewhatis.html

相关内容