且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Linux命令(17):help命令

更新时间:2022-09-22 12:21:58

help命令


功能说明

    help命令只能显示shell内部的命令帮助信息。而对于外部命令的帮助信息只能使用man或者info命令查看,还可以使用--help命令显示命令的使用信息。用法如下:

  help (选项) (参数)

命令参数

选项 含义
-d 输出每个主题的简短描述
-m 以 man 手册的格式显示使用方法
-s 显示简单的帮助信息

示例

    查使用help显示内部cd命令的帮助信息

[root@c7 ~]# type cd                                       #查看cd是内嵌命令

cd 是 shell 内嵌

[root@c7 ~]# help cd                                       #查看cd帮助信息

cd: cd [-L|[-P [-e]]] [dir]

    Change the shell working directory.

    

    Change the current directory to DIR.  The default DIR is the value of the

    HOME shell variable.

...略

[root@c7 ~]# help -d cd                                   #使用-d选项,查看命令的简短描述

cd - Change the shell working directory.

[root@c7 ~]# help -m cd                                  #使用-m选项,以man手册查看

NAME

    cd - Change the shell working directory.


SYNOPSIS

    cd [-L|[-P [-e]]] [dir]


DESCRIPTION

...略

[root@c7 ~]# help -s cd                                    #使用-s选项,简单帮助信息

cd: cd [-L|[-P [-e]]] [dir]




      本文转自cix123  51CTO博客,原文链接:http://blog.51cto.com/zhaodongwei/1871458,如需转载请自行联系原作者