Finding and Processing Files
2010-07-18 07:47
239 查看
locate 快一些
find 精确些
updatedb 手动生成数据库 速度较慢
/etc/undatedb.conf下
prunepaths 不更新的文件
locate -i 忽略大小写
-n 10 只显示前十个
locate -r 只支持基本的正则表达式
locate --regex 支持扩展的正则表达式
find
find [options][path][conditions][-action]
例子: find /etc -name "passwd"
globing
路径如果省略表示当前目录
find /etc -name "passwd" -exec(可以执行额外的命令)
find /etc -name(严格区分大小写的 -iname可忽略大小写 -lneme链接文件) "passwd" |xargs chmod
-user/-group 以用户名/属组 来查看
find -nouser/nogroup 没有删除的用户/没有属组的
与 -a 或 -o 非 -not ,!
例子: find /etc -user root -a -name "*passwd"
fid /etc -not -user root
当前用户下既不是用户,又不会是名字中包含passwd
fing /etc -not -user root -o -not -name "*passwd"
-perm mode
-perm /mode
-perm -mode
find ./ -perm /444
"-"表示三类用户必须同时包含
-type
f
d
l
b
c
p
s
根据文件的大小查看
b:512
c:kb
M:mb
G:gb
find ./ -size 2M/+2M/-2M 2M精确/大于2M/小于2M 查找时单位必须统一
根据时间查找 默认单位 :天
-atime + | ―n 在n之前/在n之后
-mtime 改变过文件内容
-ctime 改变过原数据
默认分钟
-amin
-mmin
-cmin
-newer比最近访问时间更短的
-exec 直接执行 find /etc -name "passwd *" -etc ls -l {} \; {}为占位符类似于正则表达式的反向引用
-ok 提示执行
本文出自 “骑虎南下” 博客,请务必保留此出处http://battle.blog.51cto.com/1888131/351718
相关文章推荐
- RH033 Unit 13 Finding and Processing Files
- running 5 Finding and Processing Files
- RH033 Unit13 Finding and Processing Files
- RH033 Unit13 Finding and Processing Files
- RH033读书笔记(12)-Lab 13 Finding and Processing Files
- Scrapy学习笔记九--Downloading and processing files and images
- Finding files on a *nix/Linux and sorting by size
- 如何记录Production Order and Processing Order的历史修改记录
- image and video processing听课笔记(七)
- Multiple Files Upload in ASP.NET and ASP.NET with jQuery
- image and video processing听课笔记(九)
- List files and directories
- Chinese Language Processing and Chinese Computing
- 《Microsoft Sql server 2008 Internals》读书笔记--第三章Databases and Database Files(3)
- How to locate the log files and troubleshoot Rapid Install for Release 12.0.x and 12.1.x [ID 452120.1]
- About REG, DAT, BIB, and DB files
- Gilles Aubert, Pierre Kornprobst, «Mathematical Problems in Image Processing: Partial Differential Equations and the Calculus of
- Linux - 操作文件与目录(manipulating files and directories)
- Ignore Files and Directories in Subversion
- Converting RDL and RDLC Files