find命令

Usage: find [path...] [expression]

expression may consist of: operators, options, tests, and actions:——表达式可以有operators, options, tests, and actions组成

 

operators (decreasing precedence; -and is implicit where no others are given):
!/-not
-a/-and
-o/-or

 

positional options (always true): -daystart -follow -regextype

normal options (always true, specified before other expressions):
-depth --help -maxdepth LEVELS -mindepth LEVELS -mount -noleaf
--version -xdev -ignore_readdir_race -noignore_readdir_race

 

tests (N can be +N or -N or N):

-amin N #查找N分钟之内访问过的文件,N为负值表示查找以前的(access time)
-anewer FILE
-atime N #查找N天之内访问过的文件
-cmin N #查找N分钟之内修改过的文件,N为负值表示查找以前的(change time)
-cnewer FILE
-ctime N
-empty #查找空文件
-false
-fstype TYPE
-gid N #查找group id等于N的文件,group id用id命令获取
-group NAME
-ilname PATTERN
-iname PATTERN
-inum N
-iwholename PATTERN
-iregex PATTERN
-links N
-lname PATTERN
-mmin N #查找N分钟之内修改过的文件,N为负值表示查找以前的(modify time)
-mtime N
-name PATTERN # 查找匹配到的文件
-newer FILE
-nouser
-nogroup
-path PATTERN
-perm [+-]MODE
-regex PATTERN
-wholename PATTERN
-size N[bcwkMG] #按照文件大小进行查找,-N表示文件大小小于N,+N表示文件大小大于N
-true
-type [bcdpflsD]
-uid N #查找user id等于N的文件,user id用id命令获取
-used N
-user NAME
-xtype [bcdpfls]
-context CONTEXT

actions: -delete -print0 -printf FORMAT -fprintf FILE FORMAT -print
-fprint0 FILE -fprint FILE -ls -fls FILE -prune -quit
-exec COMMAND ; -exec COMMAND {} + -ok COMMAND ;
-execdir COMMAND ; -execdir COMMAND {} + -okdir COMMAND ;

posted @ 2018-03-21 20:07  wbz_blogs  阅读(104)  评论(0编辑  收藏  举报