W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
該命令是bash內(nèi)建命令,用于顯示bash內(nèi)建命令的幫助信息。
help命令 help命令只能顯示bash內(nèi)建命令的幫助信息,而對于外部命令的幫助信息只能使用man或者info命令查看。
help(選項)(參數(shù))
-d:顯示內(nèi)建命令的簡要描述。
-m:按照man手冊的格式輸出內(nèi)建命令的幫助信息。
-s:僅輸出內(nèi)建命令的命令格式。
不指定選項時:輸出的幫助信息類似于-m選項,但是缺少段落名稱和'SEE ALSO','IMPLEMENTATION'部分。
bash內(nèi)建命令(可以為多個,請用空格分隔開)。
Q:有哪些命令是bash內(nèi)建命令?我如何判斷一個命令是否為bash內(nèi)建命令?
A:您可以在終端使用 'man builtin' 或 'man builtins' 來獲?。荒梢圆榭碽ash內(nèi)建命令 'type' 的幫助信息。
Q:那么help命令本身的幫助信息如何獲???
A:把help作為參數(shù)傳給help命令;)
Q:為什么echo也可以用 'man echo' 來查看幫助信息?
A:因為除了bash內(nèi)建的echo,GNU/linux的coreutils包里也有該命令;在echo的man手冊中,DESCRIPTION段落的 'NOTE' 也提示了和同名內(nèi)建的不同。
PS:當(dāng)你在shell腳本里定義了一個叫 'echo' 的函數(shù),那么調(diào)用的時候優(yōu)先級會如何呢?
請參考 'builtin' 命令
Q:我需要獲得更多的bash的相關(guān)幫助信息
A:限于篇幅和主題,您可以在終端執(zhí)行 'man bash' , 'info bash' ,訪問bash官方網(wǎng)站,以及搜索引擎等。
使用help命令顯示shell內(nèi)部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.
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: