linux shell 入门学习笔记13 内置外置命令

概念

什么叫做内置命令,什么叫做外置命令?

内置命令:在系统启动时就加载入内存,常驻内存,执行效率更高,但是占用资源,cd
外置命令:系统需要从硬盘中读取程序文件,再读入内存加载

例如:

xiao123@xiao123:~/Downloads/shscripts$ type cd    #bash 内置命令
cd is a shell builtin
xiao123@xiao123:~/Downloads/shscripts$ type awk   #bash 外置命令
awk is /usr/bin/awk
xiao123@xiao123:~/Downloads/shscripts$
区别

外置命令一定会开启子进程执行。
内置命令不会开启子进程去执行。
内置命令与shell是一体的,不需要单独去读取某个文件,系统启动后,就执行在内存中了。

验证是否是内置命令

type:检查Linux内置命令。

查看Linux内置shell命令

comgen -b:查看Linux当前的shell内置命令。

xiao123@xiao123:~/Downloads/shscripts$ compgen -b
.
:
[
alias
bg
bind
break
builtin
caller
cd
command
compgen
complete
compopt
continue
declare
dirs
disown
echo
enable
eval
exec
exit
export
false
fc
fg
getopts
hash
help
history
jobs
kill
let
local
logout
mapfile
popd
printf
pushd
pwd
read
readarray
readonly
return
set
shift
shopt
source
suspend
test
times
trap
true
type
typeset
ulimit
umask
unalias
unset
wait
xiao123@xiao123:~/Downloads/shscripts$
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值