欢迎来到Felix的博客

Do the right things! And talk is cheap,show me your code!

linux系列(十七):whereis命令

1、命令格式:

  whereis [-bmsu] [BMS 目录名 -f ] 文件名

2、命令功能:

whereis命令是定位可执行文件、源代码文件、帮助文件在文件系统中的位置。这些文件的属性应属于原始代码,二进制文件,或是帮助文件。whereis 程序还具有搜索源代码、指定备用搜索路径和搜索不寻常项的能力。

3、命令参数:

-b   定位可执行文件。
-m   定位帮助文件。
-s   定位源代码文件。
-u   搜索默认路径下除可执行文件、源代码文件、帮助文件以外的其它文件。
-B   指定搜索可执行文件的路径。
-M   指定搜索帮助文件的路径。
-S   指定搜索源代码文件的路径。

4、简单实例:

(1)、将和某文件相关的文件都查找出来

felix@felix-computer:~$ whereis git
git: /usr/bin/git /usr/share/man/man1/git.1.gz
felix@felix-computer:~$ whereis python
python: /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/python3.6m-config /usr/bin/python /usr/bin/python2.7-config /usr/bin/python2.7 /usr/bin/python3.6-config /usr/lib/python3.7 /usr/lib/python3.6 /usr/lib/python2.7 /etc/python3.6 /etc/python /etc/python2.7 /usr/local/lib/python3.6 /usr/local/lib/python2.7 /usr/include/python3.6 /usr/include/python3.6m /usr/include/python2.7 /usr/include/python3.6dm /usr/share/python /usr/share/man/man1/python.1.gz
felix@felix-computer:~$ 

(2)、-b  -m  -s的应用

felix@felix-computer:~$ whereis -b git
git: /usr/bin/git
felix@felix-computer:~$ whereis -m git
git: /usr/share/man/man1/git.1.gz
felix@felix-computer:~$ whereis -s git
git:
felix@felix-computer:~$ 


说明:-b : 只将二进制文件查找出来
   -m : 查出说明文档路径
   -s :找到source源文件

 

posted @ 2018-11-25 11:23  寂静的天空  阅读(1526)  评论(0编辑  收藏  举报
个人感悟: 一个人最好的镜子就是自己,你眼中的你和别人眼中的你,不是一回事。有人夸你,别信;有人骂你,别听。一根稻草,扔街上就是垃圾;捆上白菜就是白菜价;捆上大闸蟹就是大闸蟹的价。 一个人,不狂是没有出息的,但一直狂,肯定是没有出息的。雨打残花风卷流云,剑影刀光闪过后,你满脸冷酷的站在珠峰顶端,傲视苍生无比英武,此时我问你:你怎么下去? 改变自己就是改变自己的心态,该沉的时候沉下去,该浮的时候浮上来;不争名夺利,不投机取巧,不尔虞我诈;少说、多听、多行动。人每所谓穷通寿夭为命所系,岂不知造物之报施,全视人之自取。 座佑铭:每一个不曾起舞的日子,都是对生命的辜负。