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