Linux每天学习一个命令之whereis命令
2016-05-03 14:34:54 来源:慕课网
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命令多用于程序的命令查找