bash$ type -a lshw
lshw is /usr/bin/lshw
bash$ type -a ls
ls is aliased to `ls --color=auto'
ls is /bin/ls
bash$ zsh
zsh% type -a which
which is a shell builtin
which is /usr/bin/which
在 Bash 中,函数 type -a也将显示函数定义。您可以使用 declare -f functionname做同样的事情(您必须对 zsh 使用它,因为 type -a不这样做)。