whatis命令怎么在Linux系统中使用
更新:HHH   时间:2023-1-7


whatis命令怎么在Linux系统中使用?相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。

什么是Linux系统

Linux是一种免费使用和自由传播的类UNIX操作系统,是一个基于POSIX的多用户、多任务、支持多线程和多CPU的操作系统,使用Linux能运行主要的Unix工具软件、应用程序和网络协议。

01. 命令概述

whatis命令在一些特定的包含系统命令的简短描述的数据库文件里查找关键字,然后把结果送到标准输出。 查找的内容必须完全匹配关键字的才会输出。whatis数据库文件是用/usr/sbin/makewhatis 命令建立的。

02. 命令格式

whatis [OPTION…] 关键词…

03. 常用选项

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

Usage: whatis [OPTION...] 关键词...

 

 -d, --debug        输出调试信息

 -v, --verbose       输出详细的警告信息

 -r, --regex        把每个关键词都当作正则表达式解读

 -w, --wildcard       关键词里包含通配符

 -l, --long         不要把输出按终端宽度截断

 -C, --config-file=文件  使用该用户设置文件

 -L, --locale=区域    定义本次搜索所使用的区域设置

 -m, --systems=系统    use manual pages from other systems

 -M, --manpath=路径    设置搜索手册页的路径为“路径”

 -s, --sections=列表, --section=列表

               search only these sections (colon-separated)

 -?, --help         give this help list

   --usage        give a short usage message

 -V, --version       print program version

04. 参考示例

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

[deng@localhost ~]$ whatis ls

ls (1)        - 列目录内容

ls (1p)       - list directory contents

 

[deng@localhost ~]$ whatis cp

cp (1)        - 复制文件和目录

cp (1p)       - copy files

 

[deng@localhost ~]$ whatis chown

chown (1)      - 修改文件所有者和组别

chown (1p)      - change the file ownership

chown (2)      - change ownership of a file

chown (3p)      - change owner and group of a file

 

[deng@localhost ~]$ whatis man

man (1)       - 格式化并显示在线帮助手册页

man (7)       - 格式化手册页的宏

man (1p)       - display system documentation

[deng@localhost ~]$

如果需要重建这个命令相关信息的数据库,执行以下命令:

1

[root@localhost ~]# makewhatis

注意:Centos7.5暂时不支持该命令。

看完上述内容,你们掌握whatis命令怎么在Linux系统中使用的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注天达云行业资讯频道,感谢各位的阅读!

原文链接:https://blog.csdn.net/dengjin20104042056/article/details/95239198

返回系统运维教程...