Linux常用命令-which

命令

which

描述

shows the full path of (shell) commands
显示命令路径

用法

1
which COMMAND [...]

选项

注意

系统默认了以下which选项

示例

1
2
3
4
5
6
7
8
9
10
# 系统默认的which选项
$ alias which
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
$ which ls
alias ls='ls -p --color=auto'
/usr/bin/ls
$ which pwd
/usr/bin/pwd
$ which hostname
/usr/bin/hostname