type命令 – 显示指定命令的类型

438次阅读
没有评论

type 命令用来显示指定命令的类型,判断给出的指令是内部指令还是外部指令。

语法格式:type [参数] [命令]

常用参数:

lias 别名
keyword 关键字,Shell 保留字
function 函数,Shell 函数
builtin 内建命令,Shell 内建命令
file 文件,磁盘文件,外部命令
unfound 没有找到

参考实例

别名命令:

[root@linuxvip ~]# type ls
ls is aliased to `ls --color=auto'

内建命令:

[root@linuxvip ~]# type cd
cd is a shell builtin

关键字:

[root@linuxvip ~]# type if
if is a shell keyword

正文完