whereis:显示命令及相关文件全路径

xiaohai 2021-05-07 23:02:31 1521人围观 标签: Linux 
简介whereis命令用于定位命令的可执行文件、源码文件及man帮助文件的路径
说明

  whereis命令用于定位命令的可执行文件、源码文件及man帮助文件的路径

格式

  whereis [option] [filename]

常用参数
  • -b:查找可执行文件
  • -m:查找man帮助文件
  • -s:查找源码文件
示例
[root@localhost ~]# whereis which
which: /usr/bin/which /usr/share/man/man1/which.1.gz

[root@localhost ~]# whereis -s which
which:

[root@localhost ~]# whereis -m which
which: /usr/share/man/man1/which.1.gz

[root@localhost ~]# whereis -b which
which: /usr/bin/which