help 命令

| 选择喜欢的代码风格  

help 命令补充说明:

help 命令用于显示 Shell 内部命令的帮助信息。help 命令只能显示 Shell 内部的命令帮助信息。而对于外部命令的帮助信息只能使用 man 或者 info 命令查看。

help 命令语法:

help [-dms] [PATTERN ...]

help 命令选项:

-m:以  pseudo-manpage 页格式显示用法。

help 命令参数:

内部命令:指定需要显示帮助信息的 Shell 内部命令。

help 命令实例:

[root@TestMaster ~]
# help echo
echo: echo [-neE] [arg ...]
    Write arguments to the standard output.
    Display the ARGs on the standard output followed by a newline.
      -n        do not append a newline
      -e        enable interpretation of the following backslash escapes
      -E        explicitly suppress interpretation of backslash escapes
    `echo' interprets the following backslash-escaped characters:
      \a        alert (bell)
      \b        backspace
      \c        suppress further output
      \e        escape character
      \f        form feed
      \n        new line
      \r        carriage return
      \t        horizontal tab
      \v        vertical tab
      \\        backslash
      \0nnn     the character whose ASCII code is NNN (octal).  NNN can be
        0 to 3 octal digits
      \xHH      the eight-bit character whose value is HH (hexadecimal).  HH
        can be one or two hex digits
    Exit Status:
    Returns success unless a write error occurs.
[root@TestMaster ~]
# help shopt
shopt: shopt [-pqsu] [-o] [optname ...]
    Set and unset shell options.
    Change the setting of each shell option OPTNAME.  Without any option
    arguments, list all shell options with an indication of whether or not each
    is set.
      -o        restrict OPTNAMEs to those defined for use with `set -o'
      -p        print each shell option with an indication of its status
      -q        suppress output
      -s        enable (set) each OPTNAME
      -u        disable (unset) each OPTNAME
    Exit Status:
    Returns success if OPTNAME is enabled; fails if an invalid option is
    given or OPTNAME is disabled.