黄色片网站免费观看-黄色片网站观看-黄色片网站大全-黄色片视频网-色偷偷网址-色偷偷网站

help

該命令是bash內建命令,用于顯示bash內建命令的幫助信息。

補充說明

help命令 help命令只能顯示bash內建命令的幫助信息,而對于外部命令的幫助信息只能使用man或者info命令查看。

語法

help(選項)(參數)

選項

-d:顯示內建命令的簡要描述。
-m:按照man手冊的格式輸出內建命令的幫助信息。
-s:僅輸出內建命令的命令格式。
不指定選項時:輸出的幫助信息類似于-m選項,但是缺少段落名稱和'SEE ALSO''IMPLEMENTATION'部分。

參數

bash內建命令(可以為多個,請用空格分隔開)。

常見問題

Q:有哪些命令是bash內建命令?我如何判斷一個命令是否為bash內建命令?

A:您可以在終端使用 'man builtin' 或 'man builtins' 來獲取;您可以查看bash內建命令 'type' 的幫助信息。

Q:那么help命令本身的幫助信息如何獲取?

A:把help作為參數傳給help命令;)

Q:為什么echo也可以用 'man echo' 來查看幫助信息?

A:因為除了bash內建的echo,GNU/linux的coreutils包里也有該命令;在echo的man手冊中,DESCRIPTION段落的 'NOTE' 也提示了和同名內建的不同。

PS:當你在shell腳本里定義了一個叫 'echo' 的函數,那么調用的時候優先級會如何呢?

請參考 'builtin' 命令

Q:我需要獲得更多的bash的相關幫助信息

A:限于篇幅和主題,您可以在終端執行 'man bash' , 'info bash' ,訪問bash官方網站,以及搜索引擎等。

實例

使用help命令顯示shell內部shopt命令的幫助信息,輸入如下命令:

help shopt                #獲取shopt命令的幫助信息
shopt: shopt [-pqsu] [-o long-option] optname [optname...]
    Toggle the values of variables controlling optional behavior.
    The -s flag means to enable (set) each OPTNAME; the -u flag
    unsets each OPTNAME.  The -q flag suppresses output; the exit
    status indicates whether each OPTNAME is set or unset.  The -o
    option restricts the OPTNAMEs to those defined for use with
    `set -o'.  With no options, or with the -p option, a list of all
    settable options is displayed, with an indication of whether or
    not each is set.