判断linux命令是否为内置命令

Linux有许多内置命令,内置命令type可以用来判断一个命令是否为内置命令。

type: usage: type [-afptP] name [name ...]
[root@vm-centos tor]# type ulimit ulimit is a shell builtin
[root@vm-centos tor]# type tor
tor is /usr/local/bin/tor
[root@vm-centos tor]# type -t tor
file
[root@vm-centos tor]# type -t ulimit
builtin
[root@vm-centos tor]# type -a ls
ls is aliased to `ls --color=auto'
ls is /bin/ls
[root@vm-centos tor]# type ls
ls is aliased to `ls --color=auto'
[root@vm-centos tor]#

发表评论

电子邮件地址不会被公开。

*