Linux命令与文件查找

1、查找命令的完整文件:which [-a] command

 2、文件的查找

(1):whereis ---只查找某些特定目录下的文件:whereis [-bmsu] 文件名或目录名
A、列出查询的主要目录

 

(2)locate--利用数据库来查找文件名,由已建立的的数据库 /var/lib/mlocate/mlocate.db里面的数据所查到的。locate   [-ir]  keyword

输出5行与passwd相关的文件名。输入 locate passwd ,那么在完整文件名当中,只要有passwd在其中,就会被显示出来。

 (3):find 【PATH] [OPTION] [ACTION]

 find -name filename 查找文件名为filename的文件

 查找文件名中包含“name”关键字的文件

原文地址:https://www.cnblogs.com/yijierui/p/14015854.html