当前位置:首页 > 服务器类 > Linux服务器 > > Linux指令篇:档案目录管理--find

Linux指令篇:档案目录管理--find

点击次数:25 次 发布日期:2008-11-29 15:45:42 作者:源代码网
源代码网推荐
源代码网推荐
源代码网推荐  名称 : find
源代码网推荐  用法 : find
源代码网推荐  使用说明 :
源代码网推荐  
源代码网推荐  将档案系统内符合 expression 的档案列出来。你可以指要档案的名称、类别、时间、大小、权限等不同资讯的组合,只有完全相符的才会被列出来。
源代码网推荐  
源代码网推荐  find 根据下列规则判断 path 和 expression,在命令列上第一个 - ( ) , ! 之前的部份为 path,之后的是 expression。如果 path 是空字串则使用目前路径,如果 expression 是空字串则使用 -print 为预设 expression。
源代码网推荐  
源代码网推荐  expression 中可使用的选项有二三十个之多,在此只介绍最常用的部份。
源代码网推荐  
源代码网推荐  -mount, -xdev : 只检查和指定目录在同一个档案系统下的档案,避免列出其它档案系统中的档案
源代码网推荐  -amin n : 在过去 n 分钟内被读取过
源代码网推荐  -anewer file : 比档案 file 更晚被读取过的档案
源代码网推荐  -atime n : 在过去 n 天过读取过的档案
源代码网推荐  -cmin n : 在过去 n 分钟内被修改过
源代码网推荐  -cnewer file :比档案 file 更新的档案
源代码网推荐  -ctime n : 在过去 n 天过修改过的档案
源代码网推荐  -empty : 空的档案-gid n or -group name : gid 是 n 或是 group 名称是 name
源代码网推荐  -ipath p, -path p : 路径名称符合 p 的档案,ipath 会忽略大小写
源代码网推荐  -name name, -iname name : 档案名称符合 name 的档案。iname 会忽略大小写
源代码网推荐  -size n : 档案大小 是 n 单位,b 代表 512 位元组的区块,c 表示字元数,k 表示 kilo bytes,w 是二个位元组。-type c : 档案类型是 c 的档案。
源代码网推荐  d: 目录
源代码网推荐  c: 字型装置档案
源代码网推荐  b: 区块装置档案
源代码网推荐  p: 具名贮列
源代码网推荐  f: 一般档案
源代码网推荐  l: 符号连结
源代码网推荐  s: socket
源代码网推荐  -pid n : process id 是 n 的档案
源代码网推荐  
源代码网推荐  你可以使用 ( ) 将运算式分隔,并使用下列运算。
源代码网推荐  exp1 -and exp2
源代码网推荐  ! expr
源代码网推荐  -not expr
源代码网推荐  exp1 -or exp2
源代码网推荐  exp1, exp2
源代码网推荐  范例:
源代码网推荐  将目前目录及其子目录下所有延伸档名是 c 的档案列出来。
源代码网推荐   # find . -name "*.c"
源代码网推荐  
源代码网推荐  将目前目录其其下子目录中所有一般档案列出
源代码网推荐   # find . -ftype f
源代码网推荐  
源代码网推荐  将目前目录及其子目录下所有最近 20 分钟内更新过的档案列出
源代码网推荐   # find . -ctime -20
源代码网推荐  
源代码网推荐  find . -name "*" -exec grep xxx {} ; -print |morexxx为你想要找的字符串
源代码网推荐  
源代码网推荐  
源代码网推荐  
源代码网推荐  
源代码网推荐
源代码网推荐
源代码网推荐
源代码网推荐
源代码网供稿.
网友评论 (0)
会员中心
服务器类
本站推荐
服务器类之精华