find and locate find用于查找文件名,locate查找本地数据库,新创建的文件需更新数据库才能查找。grep 查找文件内容。
Locate.common :基于文件名或者路径查找数据库,locate对目录具有read权限。
**Meth:**locate [option] filename/path
-i 忽略大小写
-n N,N为数值,返回查找的头5行
更新数据库
updatedb
Find 查找文件会根据用户的账号,用户使用find命令需具有read and execute 权限,(主要通过ll,跟文件属性有关)
Meth:
find /dir -name [option ] file_name
-iname 忽略大小写
-user username 查找用户的目录
-group groupname 查找群
-uid
-gid
-perm 查找权限
-size 查找文件大小
-mmin 时间 + 大于时间多少分钟以前 -小于多少分钟之前
-type d , f, l , b文件类型
-links N+硬链接大于给的号码,-少于给的号码连接
创作不易,欢迎点赞或者关注收藏,你每一次的点赞和收藏都是作者的动力,内容如有问题请私信随时联系作者,谢谢!