linux 文件查找,which,whereis,locate,find

linux 文件查找,which,whereis,locate,find

一:which

   主要用于查找可执行命令的所在位置;

    如图,查找命令 ls的目录;

二:whereis

   主要用于查找命令的帮助文件,二进制,源文件等;

   比如,查找命令 ls

三:locate

   基于linux自己数据库的文件快速查找;

    查找速度快;

  新增加的文件可能立刻,查询不到,此时要手动更新linux数据库

 sudo updatedb

  比如:查找新建立文件 hi.txt

四:find 

 基于linux文件系统的查找,速度没有locate快

 比如:在当前目录下,查找 hi.txt

参考:http://edu.51cto.com/lesson/id-19493.html

原文地址:https://www.cnblogs.com/cocoajin/p/3771258.html