type命令用來顯示指定命令的類型,判斷給出的指令是內部指令還是外部指令。
基本介紹
- 中文名:type
- 釋義:用來顯示指定命令的類型
- 分類:Unix命令
命令類型
語法
type (選項) (參數)
參數
選項
-a
type -a pwd
-p
type -p dash
-t
type -t pwd
type -t cp
type -t ls
type -t while
實例
[root@localhost ~]# type ls
ls is aliased to `ls --color=tty'
[root@localhost ~]# type cd
cd is a shell builtin
[root@localhost ~]# type date
date is /bin/date
[root@localhost ~]# type mysql
mysql is /usr/bin/mysql
[root@localhost ~]# type nginx
-bash: type: nginx: not found
[root@localhost ~]# type if
if is a shell keyword
[root@localhost ~]# type which
which is aliased to `alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
[root@localhost ~]# type -a cd
cd is a shell builtin
[root@localhost ~]# type -a grep
grep is /bin/grep