如何在Linux系统中获取命令的帮助信息

想要获取Linux系统中命令的帮助信息,要知道在Linux系统中,命令分为两个部分,分别是内部命令和外部命令。

内部命令:在系统启动时就调入内存,是常驻内存的,所以执行效率高。
外部命令:是系统的软件功能,用户需要时才从硬盘中读入内存。

想要判断这个命令是内部命令还是外部命令:type COMMAND
在这里插入图片描述

内部命令获取帮助信息:
1、help COMMAND
[root@centos7mage /]# help cd
2、man COMMAND
[root@centos7mage /]# man cd
3、info COMMAND
[root@centos7mage /]# info cd

外部命令获取帮助信息:
1、COMMAND --help
[root@centos7mage /]# awk --help
2、man COMMAND
[root@centos7mage /]# man awk
3、info COMMAND
[root@centos7mage /]# info awk

man文档章节的划分:
1 Executable programs or shell commands      <可执行程序或shell命令>
2 System calls (functions provided by the kernel)    < 系统调用(内核提供的功能)>
3 Library calls (functions within program libraries)    <库调用 (程序库中的函数)>
4 Special files (usually found in /dev)    <特殊文件(通常位于/dev中)>
5 File formats and conventions eg /etc/passwd    < 文件格式和约定(例如/etc/passwd)>
6 Games
7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)    <杂项(包括宏包和管理)>
8 System administration commands (usually only for root)    < 系统管理命令(通常仅用于root)>
9 Kernel routines [Non standard]    <内核例程[非标准]>

注:
1.并非每个命令在所有章节下都有手册。
2.可以通过whatis查看命令存在哪些章节。
3.whatis执行过程是查询数据进行的,如果有新命令需要手动更新数据库:#makewhatis

猜你喜欢

转载自blog.csdn.net/qq_42216173/article/details/82969029