Bash Shell有哪些内置命令
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,这篇文章主要讲解了"Bash Shell有哪些内置命令",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Bash Shell有哪些内置命令"吧!内置命令的
千家信息网最后更新 2026年11月02日Bash Shell有哪些内置命令
这篇文章主要讲解了"Bash Shell有哪些内置命令",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Bash Shell有哪些内置命令"吧!
内置命令的类型
Bourne Shell 内置命令:内置命令继承自 Bourne Shell。
Bash 内置命令:特定于 Bash 的内置命令表。
修改 Shell 行为:修改 shell 属性和可选行为的内置命令。
特别的内置命令:由 POSIX 特别分类的内置命令。
如何查看所有 bash 内置命令
有以下的命令:
$ 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
查看 Bash 的内置命令信息
运行以下得到详细信息:
help commandhelp read
要仅得到所有带简短描述的内置命令的列表,执行如下:
$ help -d
查找内置命令的语法和其他选项
使用下列语法去找出更多的相关内置命令:
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有哪些内置命令"的内容了,经过本文的学习后,相信大家对Bash Shell有哪些内置命令这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!
命令
学习
输出
信息
内容
更多
行为
语法
简短
就是
属性
思路
情况
文章
知识
知识点
篇文章
类型
跟着
还是
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
广州为想互联网科技有限公司
互联网科技有限公司经营范围
厦门中拓互联网络科技有限公司
小马过河互联网科技
天津摩尔互联网科技
时间互联网络科技
互联网高科技企业
中国互联网金融科技基金
美国互联网前沿科技
湖南洣水互联网科技有限公司扣款
团飞科技与伯堂互联网服务平台
金融科技与互联网金融相同和不同
想开互联网科技公司怎么样
允成互联网科技有限公司融资
佛山市翊博互联网络科技有限公司
华中科技大学互联网的牛人
互联网科技快讯热点
万物互联网智能科技
众联互联网络科技
承德科技产业互联网平台
互联网科技公司税收优惠
农村开互联网科技讲堂
现代科技和互联网有关系吗
创业天下互联网科技有限公司
互联网系的金融科技公司
互联网金融中的现代科技
怎样加入科技互联网
富国互联网金融科技混合基金
上海创道互联网络科技有限公司
东风日产互联网科技公司叫什么