首页 > 开发 > linux > 正文

Linux每天学习一个命令之whereis命令

2016-05-03 14:34:54  来源:慕课网
whereis -[bmsu] 文档名或目录名的所在路径-l :可以列出where会去查询的几个主要目录-b : 只找出二进制格式的文档-m : 只找出说明文档manual路径下的文档-s : 只找出source来源档案-u : 搜寻不在上述三个项目当中的其他特殊文档   下面来看看几个例子:
Example 1:查看跟ifconfig有关的文档
[root@localhost shell]# whereis ifconfigifconfig: /usr/sbin/ifconfig /usr/share/man/man8/ifconfig.8.gz  Example 2:查看ls的帮助文档:
[root@localhost ~]# whereis -m lsls: /usr/share/man/man1/ls.1.gz /usr/share/man/man1p/ls.1p.gz  Example 3:查看whereis会去查询的目录:
[root@localhost ~]# whereis -lbin: /usr/binbin: /usr/sbinbin: /usr/libbin: /usr/lib64man: /usr/share/man/man0pman: /usr/share/man/man1man: /usr/share/man/man1pman: /usr/share/man/man1xman: /usr/share/man/man2man: /usr/share/man/man2xman: /usr/share/man/man3man: /usr/share/man/man3pman: /usr/share/man/man3x省略部分结果  从上面的例子中可以看出当执行whereis 目录名时列出所有跟目录名有关内容的路径;
而加相关选项的的whereis 命令只列出相应的文件路径,入-m只列出manual目录下的手册文件;
同时可以看出whereis命令多用于程序的命令查找