用途说明
whereis命令用来查找命令的位置,包括执行文件、源代码和手册页文件(locate the binary, source, and manual page files for a command)。如果要查找任意文件的所在位置,可以使用locate或者find等命令。
常用参数 格式:whereis 查找指定命令的位置,包括执行文件、源代码和手册页文件。 格式:whereis -b 只查找指定命令的执行文件位置。 格式:whereis -m 只查找指定命令的手册页文件所在位置。 格式:whereis -s 只查找指定命令的源代码所在位置。 使用示例 示例一 [root@jfht ~]# whereis whereis whereis: /usr/bin/whereis /usr/share/man/man1/whereis.1.gz [root@jfht ~]# whereis -b whereis whereis: /usr/bin/whereis [root@jfht ~]# whereis -m whereis whereis: /usr/share/man/man1/whereis.1.gz [root@jfht ~]# whereis -s whereis whereis: [root@jfht ~]# 示例二 [root@jfht ~]# whereis mysql mysql: /usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz [root@jfht ~]# whereis -b mysql mysql: /usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql [root@jfht ~]# whereis -m mysql mysql: /usr/share/man/man1/mysql.1.gz [root@jfht ~]# whereis -s mysql mysql: [root@jfht ~]#