笔记——whatis命令(1)

用虚拟机terminal输入man whatis查看相关说明
用虚拟机VMware ubuntu 里面的terminal输入man whatis查看相关说明
在这里插入图片描述

WHATIS(1) 查询命令功能

Manual pager utils 手动寻呼机实用程序/手动寻呼机

NAME名字

whatis - display one-line manual page descriptions 显示单行手册页说明

SYNOPSIS概要

whatis [-dlv?V] [-r|-w] [-s list] [-m system[,…]] [-M path] [-L locale] [-C file] name …
whatis [- dlv?V] [-r|-w] [-s列表] [-m系统[,…]] [-M 路径][-L 内定位][-C 文件] 名称…

DESCRIPTION描述

Each manual page has a short description available within it. whatis searches the manual page names and displays the manual page descriptions of any name matched.
每个手动页面都有简短的说明。whatis搜索手动页面名称,并显示任何匹配名称的手动页面描述。

name may contain wildcards(-w)or be a regular expression (-r). Using these options, it may be necessary to quote the name or escape () the special characters to stop the shell from interpreting them.
名称可能包含通配符(-w)或常规表达(-r)。使用这些选项,可能需要引用名称或逃生(+)特殊字符,以阻止外壳在它们中停留。

index databases are used during the search, and are updated by the mandb program. Depending on your installation, this may be run by a periodic cron job, or may need to be run manually after new manual pages have been installed. To produce an old style text whatis
database from the relative index database, issue the command:
索引数据库在搜索过程中使用,并通过mandb程序进行更新。根据您的安装情况,这可能会由定期工作运行,或者可能需要在安装新的手动页面后手动运行。要从相对索引数据库生成旧样式文本,需要发布命令:

whatis -M manpath -w ‘*’ | sort > manpath/whatis

where manpath is a manual page hierarchy such as /usr/man.
其中manpath是手动页面层次结构,如 /usr/ma

补充说明:

  1. whatis命令是用于查询一个命令执行什么功能,并将查询结果打印到终端上,相当于 man -f
  2. whatis命令在一些特定的包含系统命令的简短描述的数据库文件里查找关键字,然后把结果送到标准输出。查找的内容必须完全匹配关键字的才会输出。
    在这里插入图片描述

使用语法:

whatis 命令/系统调用/库函数/特殊文件名
在这里插入图片描述

出错显示:
在这里插入图片描述
可能原因:

1.whatis是根据数据库执行查找操作的
2.数据库是定是跟新的,但新安装的系统还未自动跟新

解决方法:

 root权限下
 使用makewhatis手动更新(OS7版本以下)
 使用mandb进行更新(OS7及其以上)

拓展说明:

执行whatis后,将会查找一个存储所有命令相关信息的数据库,根据命令名返回相关结果。
如果需要重建这个命令相关信息的数据库,执行以下命令:makewhatis
(whatis数据库文件是用/usr/sbin/makewhatis 命令建立的。)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值