linux中whereis命令

 

1、该指令只能用于查找二进制文件、源代码文件和man手册页,一般文件的定位需使用locate、find命令。

root@DESKTOP-1N42TVH:/home/test# whereis top         ## 输出了二进制文件和man手册叶
top: /usr/bin/top /usr/share/man/man1/top.1.gz

 

2、-b选项仅查找二进制文件

root@DESKTOP-1N42TVH:/home/test# whereis -b top    ## 仅查找二进制文件
top: /usr/bin/top

 

3、-选项仅查找man帮助文件

root@DESKTOP-1N42TVH:/home/test# whereis -m top    ## 仅查找man帮助文件
top: /usr/share/man/man1/top.1.gz

 

4、whereis不查找普通文件

root@DESKTOP-1N42TVH:/home/test# touch top     ## 创建top普通文件
root@DESKTOP-1N42TVH:/home/test# ls
top
root@DESKTOP-1N42TVH:/home/test# whereis top    ## whereis命令不查找普通文件
top: /usr/bin/top /usr/share/man/man1/top.1.gz
root@DESKTOP-1N42TVH:/home/test# find top       ## 普通文件的查找使用locate、find命令
top

 

参考:https://www.runoob.com/linux/linux-comm-whereis.html

 

posted @ 2022-04-30 23:19  小鲨鱼2018  阅读(460)  评论(0编辑  收藏  举报