find path -option .. |xargs 命令
====================================================
-name filename # 查找的文件名 通配时别忘了引号 “a*[^a-z].ko”
-perm -0640 或0640 # 查找-为包含权限或绝对权限的文件
-user username # 按文件属主来查找
-group groupname # 按所属组来查找
-mtime -n +n # 按文件更改时间来查找文件,-n指n天以内,+n指n天以前
-atime -n +n # 按文件访问时间来查找文件,-n指n天以内,+n指n天以前
-ctime -n +n # 按inode更改时间来查找文件,-n指n天以内,+n指n天以前
-mmin +n # n分钟前改动过的文件
-amin +n # n分钟前被存取过的文件
-nogroup # 查无有效属组的文件,属组在/etc/groups中不存在
-nouser # 查无有效属主的文件,属主在/etc/passwd中不存
-newer f1 -and ! -newer f2 # 查更改时间比f1新但比f2旧的文件
-type b/d/c/p/l/f # 查是块设备、目录、字符设备、管道、符号链接、普通文件
-size [+- ] n c w k M G # n:512bytes c:1byte w:2bytes k:1024bytes MB GB +大-小
-depth # 使查找在进入子目录前先行查找完本目录
-fstype ext3 # 查找的文件系统类型
-mount # 只查找当前mount点
-printf %F # 显示找到文件所在的FS类型
-follow # 如果遇到符号链接文件,就跟踪链接所指的文件
-cpio # 对匹配的文件使用cpio命令,将他们备份到磁带设备中
-prune # 忽略某个目录
-empty # 查找空的文件或空目录
-gid -uid +-uid # 大于+ 小于-
-a -and -o -or # 逻辑与 逻辑或
====================实例================================
touch -t [YY]MMDDhhmm time.file # 建立某时间的空文件
find /home -newer time.file # 在/home下查更新时间比time.file 近的文件或目录
find /home -anewer time.file # 在/home下查存取时间比time.file 近的文件或目录
find /home -used -2 # 列出文件或目录被改动过之后,在2日内被存取过的文件或目录
find /home -name tmp.txt -maxdepth 4 深度最多为3层
find /home -name tmp.txt -mindepth 3 从第2层开始查
find /home -links +2 查硬连接数大于2的文件或目录
find / -false 查找系统中总是错误的文件
find / -gid n 组id为n的文件
-name filename # 查找的文件名 通配时别忘了引号 “a*[^a-z].ko”
-perm -0640 或0640 # 查找-为包含权限或绝对权限的文件
-user username # 按文件属主来查找
-group groupname # 按所属组来查找
-mtime -n +n # 按文件更改时间来查找文件,-n指n天以内,+n指n天以前
-atime -n +n # 按文件访问时间来查找文件,-n指n天以内,+n指n天以前
-ctime -n +n # 按inode更改时间来查找文件,-n指n天以内,+n指n天以前
-mmin +n # n分钟前改动过的文件
-amin +n # n分钟前被存取过的文件
-nogroup # 查无有效属组的文件,属组在/etc/groups中不存在
-nouser # 查无有效属主的文件,属主在/etc/passwd中不存
-newer f1 -and ! -newer f2 # 查更改时间比f1新但比f2旧的文件
-type b/d/c/p/l/f # 查是块设备、目录、字符设备、管道、符号链接、普通文件
-size [+- ] n c w k M G # n:512bytes c:1byte w:2bytes k:1024bytes MB GB +大-小
-depth # 使查找在进入子目录前先行查找完本目录
-fstype ext3 # 查找的文件系统类型
-mount # 只查找当前mount点
-printf %F # 显示找到文件所在的FS类型
-follow # 如果遇到符号链接文件,就跟踪链接所指的文件
-cpio # 对匹配的文件使用cpio命令,将他们备份到磁带设备中
-prune # 忽略某个目录
-empty # 查找空的文件或空目录
-gid -uid +-uid # 大于+ 小于-
-a -and -o -or # 逻辑与 逻辑或
====================实例================================
touch -t [YY]MMDDhhmm time.file # 建立某时间的空文件
find /home -newer time.file # 在/home下查更新时间比time.file 近的文件或目录
find /home -anewer time.file # 在/home下查存取时间比time.file 近的文件或目录
find /home -used -2 # 列出文件或目录被改动过之后,在2日内被存取过的文件或目录
find /home -name tmp.txt -maxdepth 4 深度最多为3层
find /home -name tmp.txt -mindepth 3 从第2层开始查
find /home -links +2 查硬连接数大于2的文件或目录
find / -false 查找系统中总是错误的文件
find / -gid n 组id为n的文件
转载于:https://blog.51cto.com/dywer/163940