一、whatis //显示命令的简单说明,相当于命令的介绍,安装后不可立即使用,需要制作数据库

  • \#CentOS 7 版本以后
  • mandb
  • \#CentOS 6 版本之前
  • makewhatis
  • whereis //查看命令帮助路径

二、查看命令的帮助

1、内部命令 //使用type查看是否是内部命令

①help +内部命令


② man BASH

2、外部命令

commad + --help

+ -h

3、查命令帮助的思路

①whatis cmd mandp //看看命令是干啥的

②type CMD //查看是内部命令还是外部命令

③如果是内部命令:help CMD ; man bash //man bash中有所有的内部命令

④如果是外部命令:CMD --help | -H

例子:

[root@centos8 ~]#date --help

Usage: date [OPTION]... [+FORMAT]

or: date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]

Display the current time in the given FORMAT, or set the system date.

[root@centos8 ~]#cal -h

Usage:

cal [options] [[[day] month] year]

cal [options] <timestamp|monthname>

[root@centos8 ~]#openssl --help

Invalid command '--help'; type "help" for a list.

[root@centos8 ~]#date -h

date: invalid option -- 'h'

Try 'date --help' for more information.

[root@centos8 ~]#shutdown -h

Shutdown scheduled for Fri 2020-03-20 08:26:27 CST, use 'shutdown -c' to cancel.

三、查看文件格式要求

①whatis cmd // 查看章节号

②whereis cmd //查看命令帮助路径

③man 加章节 + cmd //查看命令阿帮助章节

man 页面分组为不同的“章节”,统称为Linux手册,man 1 man

1:用户命令

2:系统调用

3:C库调用

4:设备文件及特殊文件

5:配置文件格式

6:游戏

7:杂项

8:管理类的命令

9:Linux 内核API

列出所有帮助

man -a keyword

搜索man手册

\#列出所有匹配的页面,使用 whatis 数据库

man -k keyword

相当于 whatis

man -f keyword

打印man帮助文件的路径

man -w [章节] keyword

例子 :

[root@centos8 ~]#man -w 1 passwd

/usr/share/man/man1/passwd.1.gz

[root@centos8 ~]#whatis passwd

openssl-passwd (1ssl) - compute password hashes

passwd (1) - update user's authentication tokens

[root@centos8 ~]#man 1ssl openssl-passwd

[root@centos8 ~]#dnf install man-pages

[root@centos8 ~]#man 7 ascii

[root@centos8 ~]#man 7 utf8

四、info + cmd 可以查帮助

标签: 命令, linux, root, man, 获取, help, centos8

相关文章推荐

添加新评论,含*的栏目为必填