這篇文章主要講解了“Bash Shell有哪些內(nèi)置命令”,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來(lái)研究和學(xué)習(xí)“Bash Shell有哪些內(nèi)置命令”吧!
創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比普定網(wǎng)站開(kāi)發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式普定網(wǎng)站制作公司更省心,省錢(qián),快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋普定地區(qū)。費(fèi)用合理售后完善,10年實(shí)體公司更值得信賴。
Bourne Shell 內(nèi)置命令:內(nèi)置命令繼承自 Bourne Shell。
Bash 內(nèi)置命令:特定于 Bash 的內(nèi)置命令表。
修改 Shell 行為:修改 shell 屬性和可選行為的內(nèi)置命令。
特別的內(nèi)置命令:由 POSIX 特別分類(lèi)的內(nèi)置命令。
有以下的命令:
$ help$ help | less$ help | grep read
樣例輸出:
GNU bash, version 4.1.5(1)-release (x86_64-pc-linux-gnu)These shell commands are defined internally. Type `help' to see this list.Type `help name' to find out more about the function `name'.Use `info bash' to find out more about the shell in general.Use `man -k' or `info' to find out more about commands not in this list. A star (*) next to a name means that the command is disabled. job_spec [&] history [-c] [-d offset] [n] or hist> (( expression )) if COMMANDS; then COMMANDS; [ elif C> . filename [arguments] jobs [-lnprs] [jobspec ...] or jobs > : kill [-s sigspec | -n signum | -sigs> [ arg... ] let arg [arg ...] [[ expression ]] local [option] name[=value] ... alias [-p] [name[=value] ... ] logout [n] bg [job_spec ...] mapfile [-n count] [-O origin] [-s c> bind [-lpvsPVS] [-m keymap] [-f filen> popd [-n] [+N | -N] break [n] printf [-v var] format [arguments] builtin [shell-builtin [arg ...]] pushd [-n] [+N | -N | dir] caller [expr] pwd [-LP] case WORD in [PATTERN [| PATTERN]...)> read [-ers] [-a array] [-d delim] [-> cd [-L|-P] [dir] readarray [-n count] [-O origin] [-s> command [-pVv] command [arg ...] readonly [-af] [name[=value] ...] or> compgen [-abcdefgjksuv] [-o option] > return [n] complete [-abcdefgjksuv] [-pr] [-DE] > select NAME [in WORDS ... ;] do COMM> compopt [-o|+o option] [-DE] [name ..> set [--abefhkmnptuvxBCHP] [-o option> continue [n] shift [n] coproc [NAME] command [redirections] shopt [-pqsu] [-o] [optname ...] declare [-aAfFilrtux] [-p] [name[=val> source filename [arguments] dirs [-clpv] [+N] [-N] suspend [-f] disown [-h] [-ar] [jobspec ...] test [expr] echo [-neE] [arg ...] time [-p] pipeline enable [-a] [-dnps] [-f filename] [na> times eval [arg ...] trap [-lp] [[arg] signal_spec ...] exec [-cl] [-a name] [command [argume> true exit [n] type [-afptP] name [name ...] export [-fn] [name[=value] ...] or ex> typeset [-aAfFilrtux] [-p] name[=val> false ulimit [-SHacdefilmnpqrstuvx] [limit> fc [-e ename] [-lnr] [first] [last] o> umask [-p] [-S] [mode] fg [job_spec] unalias [-a] name [name ...] for NAME [in WORDS ... ] ; do COMMAND> unset [-f] [-v] [name ...] for (( exp1; exp2; exp3 )); do COMMAN> until COMMANDS; do COMMANDS; done function name { COMMANDS ; } or name > variables - Names and meanings of so> getopts optstring name [arg] wait [id] hash [-lr] [-p pathname] [-dt] [name > while COMMANDS; do COMMANDS; done help [-dms] [pattern ...] { COMMANDS ; }
另外一種選擇是使用下列命令:
compgen -bcompgen -b | more
運(yùn)行以下得到詳細(xì)信息:
help commandhelp read
要僅得到所有帶簡(jiǎn)短描述的內(nèi)置命令的列表,執(zhí)行如下:
$ help -d
使用下列語(yǔ)法去找出更多的相關(guān)內(nèi)置命令:
help name help cd help fg help for help read help :
樣例輸出:
:: : Null command. No effect; the command does nothing. Exit Status: Always succeeds
使用 type
命令或 command
命令:
type -a command-name-here type -a cd type -a uname type -a : type -a ls
或者:
type -a cd uname : ls uname
樣例輸出:
cd is a shell builtinuname is /bin/uname: is a shell builtinls is aliased to `ls --color=auto'ls is /bin/lsl is a functionl (){ ls --color=auto}
或者:
command -V ls command -V cd command -V foo
感謝各位的閱讀,以上就是“Bash Shell有哪些內(nèi)置命令”的內(nèi)容了,經(jīng)過(guò)本文的學(xué)習(xí)后,相信大家對(duì)Bash Shell有哪些內(nèi)置命令這一問(wèn)題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!