跳转至

16. type命令

5. 内置命令、外置命令

1.通过type查看是内置还是外置命令

#内置命令
[root@151 tmp]# type type
type is a shell builtin
[root@151 tmp]# type cd
cd is a shell builtin

#外置命令
[root@151 tmp]# type ps
ps is hashed (/usr/bin/ps)
[root@151 tmp]# type docker
docker is /usr/bin/docker

2.内置命令不会产生子进程去执行,而外置命令需要

3.查看所有内置命令

[root@151 tmp]# compgen -b
ubuntu@4c16g:~$ 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

最后更新: 2022-02-19 13:59:07