ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

笔记——whatis命令(1)

2021-12-30 18:34:37  阅读:175  来源: 互联网

标签:whatis 数据库 手动 manual 笔记 命令 page


用虚拟机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 命令建立的。)

标签:whatis,数据库,手动,manual,笔记,命令,page
来源: https://blog.csdn.net/weixin_47200070/article/details/122242599

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有