通过man查找帮助过程: [chengmo@Centos5 ~]$ man -h ... f:same as whatis(1) ... #觉得比较奇怪,whatis是什么呢? [chengmo@cent
通过man查找帮助过程:
[chengmo@Centos5 ~]$ man -h
...
f:same as whatis(1)
...
#觉得比较奇怪,whatis是什么呢?
[chengmo@centos5 ~]$ man whatis
#查询得到是:
#whatis - search the whatis database for complete Words.
#它是查询whatis数据库的工具
#The whatis database is created using the command /usr/sbin/makewhatis.
#里面还说,whatis数据库 是通过/usr/bin/makewhatis建立的
收获:whatis数据库,并且有makewhatis创建,whatis脚本是用作查询的
makewhatis是怎么样工作的呢?
[chengmo@centos5 ~]$ man makewhatis
#得到:
makewhatis reads all the manual pages contained in the given sections of manpath or the prefORMatted pages con-tained in the given sections of catpath. For each page, it writes a line in the whatis database; each line consists of the name of the page and a short description, separated by a dash. The description is extracted using the content of the NAME section of the manual page.
#大概意思是:makewhatis 从手册页配置的路径以及领域范围,搜集所有手册页索引信息,每个手册页在数据库加入一行,这行会包括手册页里面name,以及简单描述。
收获:知道这个数据库是建立是索引,并且每个数据库写入一行(a line) ,会不会这个数据库就是文本文件呢?现在到这里,我们不知道数据库保存地方,也不知道它结构,只有看看whatis命令,看它是不是有源码信息
怎么得到whatis程序源码?
[chengmo@centos5 ~]$ type whatis
whatis is /usr/bin/whatis
#告诉路径我们看看内容
[chengmo@centos5 ~]$ vi /usr/bin/whatis
1 #!/bin/sh
2 #
3 # apropos -- search the whatis database for keywords.
4 # whatis -- idem, but match only commands (as whole words).
……
#它是个sh脚本,
#得到:
#grep “关键词“ /var/cache/man/whatis
#它实际在查找这个文件,/var/cache/man/whatis就是上面说的whatis 数据库
[chengmo@centos5 ~]$ head /var/cache/man/whatis
$notes_name [Module::Build::Notes] (3pm) - Configuration for $module_name
*_unlocked [unlocked_stdio] (3) - non-locking stdio functions
#whatis数据库就是一个文本文件记录手册页的索引信息
whatis数据库是什么时候创建的呢?
[chengmo@centos5 ~]$ ls -al /var/cache/man/whatis
-rw-r--r-- 1 root root 1057156 10-27 04:06 /var/cache/man/whatis
#发现创建时间是凌晨4点左右,看了这个是系统创建的,那么少不了cron怀疑了
[chengmo@centos5 ~]$ cat /etc/crontab
shell=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
有run-parts脚本运行/etc/cron.daily目录下面的文件
[chengmo@centos5 ~]$ cd /etc/cron.daily/
[chengmo@centos5 cron.daily]$ cat makewhatis.cron
#!/bin/bash
LOCKFILE=/var/lock/makewhatis.lock
makewhatis -u -w
……
找到了这个是由这个脚本运行的
以上是通过man命令查找帮助信息的一个过程,有问题,首先分析帮助是个不错的选择。
作者:chengmo QQ:8292669
--结束END--
本文标题: linux whatis与whatis database 使用及查询方法(man使用实例)
本文链接: https://www.lsjlt.com/news/19193.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
一口价域名售卖能注册吗?域名是网站的标识,简短且易于记忆,为在线用户提供了访问我们网站的简单路径。一口价是在域名交易中一种常见的模式,而这种通常是针对已经被注册的域名转售给其他人的一种方式。
一口价域名买卖的过程通常包括以下几个步骤:
1.寻找:买家需要在域名售卖平台上找到心仪的一口价域名。平台通常会为每个可售的域名提供详细的描述,包括价格、年龄、流
443px" 443px) https://www.west.cn/docs/wp-content/uploads/2024/04/SEO图片294.jpg https://www.west.cn/docs/wp-content/uploads/2024/04/SEO图片294-768x413.jpg 域名售卖 域名一口价售卖 游戏音频 赋值/切片 框架优势 评估指南 项目规模 安全指南 Osprey 游戏分析 游戏调试 游戏图形 游戏物理 开源库 魔方破解 游戏安全 反作弊 安全最佳实践 游戏逻辑 LaVie 域名转让平台 域名在哪个平台可以转让 自己的域名怎么出售 域名第三方买卖
0