1.which
[root@web ~]# which yum
/usr/bin/yum
2.type
[root@web ~]# type -a yum
yum 是 /usr/bin/yum
3.whereis
[root@web ~]# whereis yum
yum: /usr/bin/yum /etc/yum /etc/yum.conf /usr/share/man/man8/yum.8
4.locate
[root@web ~]# locate mv |grep -w mv
/usr/bin/mv
/usr/libexec/git-core/git-mv
/usr/share/doc/git-1.8.3.1/git-mv.html
/usr/share/doc/git-1.8.3.1/git-mv.txt
/usr/share/man/man1/git-mv.1.gz
/usr/share/man/man1/mv.1.gz
/usr/src/kernels/3.10.0-862.el7.x86_64/include/config/sata/mv.h
#建立表格数据库,方便查找,locate命令依赖mlocate,不推荐这种使用方法。
yum install mlocate -y
5.find
[root@web ~]# find / -type f -name "yum"
/usr/bin/yum
/usr/share/bash-completion/completions/yum
/etc/logrotate.d/yum
/etc/logrotate.d/2018-08-13/yum