转自:http://www.linuxso.com/a/linuxmingling/0/whereis.html
whereis命令是定位可执行文件、源代码文件、帮助文件在文件系统中的位置
whereis命令的语法:whereis [-bmsu] [BMS 目录名 -f ] 文件名
whereis命令的各选项含义如下:
-b 定位可执行文件。
-m 定位帮助文件。
-s 定位源代码文件。
-u 搜索默认路径下除可执行文件、源代码文件、帮助文件以外的其它文件。
-B 指定搜索可执行文件的路径。
-M 指定搜索帮助文件的路径。
-S 指定搜索源代码文件的路径。
whereis命令例子:
[[email protected] hzl126]# whereis apache2
apache2: /usr/local/apache2
[[email protected] hzl126]# whereis mysql
mysql: /usr/local/mysql
[[email protected] hzl126]# whereis httpd
httpd: /usr/sbin/httpd.event /usr/sbin/httpd.worker /usr/sbin/httpd /etc/httpd /usr/lib/httpd /usr/share/man/man8/httpd.8.gz