Linux help命令详解

help 帮助命令,用于查看Linux中其他命令的使用方法。
格式:
help <命令名称>
<命令名称> –help

内部命令用:help <命令名称>
外部命令用:<命令名称> –help
两种格式是严格区分的,不能同时支持,也就是不能混用。

例如,使用man查看type命令:man type
报错:No manual entry for type

使用外部帮助命令: type –help
显示如下:

type: type [-afptP] name [name ...]
    Display information about command type.

    For each NAME, indicate how it would be interpreted if used as a
    command name.

    Options:
      -a        display all locations containing an executable named NAME;
                includes aliases, builtins, and functions, if and only if
                the `-p' option is not also used
      -f        suppress shell function lookup
      -P        force a PATH search for each NAME, even if it is an alias,
                builtin, or function, and returns the name of the disk file
                that would be executed
      -p        returns either the name of the disk file that would be executed,
                or nothing if `type -t NAME' would not return `file'
      -t        output a single word which is one of `alias', `keyword',
                `function', `builtin', `file' or `', if NAME is an alias,
                shell reserved word, shell function, shell builtin, disk file,
                or not found, respectively

    Arguments:
      NAME      Command name to be interpreted.

    Exit Status:
    Returns success if all of the NAMEs are found; fails if any are not found.