linux 时间 find,linux find 时间_linux find 时间_linux find 文件

a04e99bc413d0c58fcb97fd7aa5abfe3.png

find用法

find [path...] [expression]

default path is the current directory; default expression is -print

--如果没有带路径linux find 时间,[path...] 为空,则默认是当前路径,如果[expression] 也是空的,则默认是-print

即只执行find为find ./ -print

一般常用的查找是:

类型匹配查找 -type ,f 为普通文件,d 为目录,l 为链接

find ./ -type d

名称匹配查找 -name ,匹配内容需要加引号

find ./ -type f -name "*.c"

0cd8c0efc232ea15b9edad65575b8faf.png

例如:设置nzg用户最近一次更改密码时间为2012-08-02 过期10天后密码设置为失效状态linux find 时间,最小修改密码时间为10天,最大修改密码时间为80天,在密码过期前2天进行警告提醒。经过我自己网上查找,杀过毒,ie9也在微软重新下载过,更新过,再也没有更多windows更新给我更新,注册表改过,internet选项改过(自定义全部启用),换过浏览器(ie内核),更新过flash player activex(现在是player11)开网页依然有提示……(360的软件我不用,谢谢,不要给我360的方法)。 表示 向上查找.其中xxx可以是正规表达式,关于正规式就不多说了. 一般来说是区分大小写的, 要想不区分大小写, 那得先输入 :set ignorecase 查找到以后, 再输入 n 查找下一个匹配处, 输入 n 反方向查找. *(#) 当光标停留在某个单词上时, 输入这条命令表示查找与该单词匹配的 下(上)一个单词. 同样, 再输入 n 查找下一个匹配处, 输入 n 反方 向查找. g*(g#) 此命令与上条命令相似。

find ./ -type f -mtime +7 -name "*log"

新旧匹配 -newer filename ,查找比finename 这个文件更新的文件

find -type f -name "*log" -newer201809150510.log

可以利用这个命令以更精细的时间戳进行查找

touch -t 201810100400.00 timetamp.txt

find -type f -name "*log" -newer timetamp.txt

取反时,在选项前加! ,比如 ! -name "*log" 为查找不以log 结尾的文件

对查找结果加以处理:-exec cmd {} \ ;

{} \; {}和\ 中间有空格,\ 后需要加分号,不加分号的话,\在命令行中表示命令未完进行换行。

1ae85e87e72b58d3343e466b145d129a.gif

将7天以前的log删除:

$ find logs -type f -mtime +5 -exec rm { } 。1. $ find logs -type f -mtime +5 -exec rm {} \。$ find logs -type f -mtime +5 -exec -ok rm {} \。

不递归查找:

find 默认是递归查找,如果只需要查找最外一层目录,将查找深度设置为1

-maxdepth LEVELS

-maxdepth 1

附find 的详细用法:

find --help

Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]

a pointer to a null-terminated string that specifies the default (working) directory for the action. if this value is null, the current working directory is used. if a relative path is provided at lpfile, do not use a relative path for lpdirectory.。the next step installs the jdk into the current directory.4.run the self-extracting binary.execute the downloaded file with the path prepended to it. for example, if the file is in the current directory, prepend it with "./" (necessary if "." is not in the path environment variable):。a good first command to learn is pwd, which stands for present working directory. this command shows the name and location of the current directory, which is the directory (also called a folder on some operating systems) in which the user is currently working. all that is necessary in order to use this command is to type the word pwd in at the keyboard as follows and then press the enter key:。

691a61177820b308cc6c1cddf5261bd0.jpg

expression may consist of: operators, options, tests, and actions:

operators (decreasing precedence; -and is implicit where no others are given):

( EXPR ) ! EXPR -not EXPR EXPR1 -a EXPR2 EXPR1 -and EXPR2

EXPR1 -o EXPR2 EXPR1 -or EXPR2 EXPR1 , EXPR2

(this is true only for comobjects you’ve created yourself if you follow microsoft’s rules for the creation of new guids。this.transport.open(this.options.method, url, true)。11. the influence of the spontaneous and positional nystagmus: when the spontaneous and positional nystagmus exist, there is also positive result.。

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 -anewer FILE -atime N -cmin N

-cnewer FILE -ctime N -empty -false -fstype TYPE -gid N -group NAME

131502903.png

-ilname PATTERN -iname PATTERN -inum N -iwholename PATTERN -iregex PATTERN

-links N -lname PATTERN -mmin N -mtime N -name PATTERN -newer FILE

find ${findpath} -nouser -nogroup -type f -exec ls -l {} \。find ${findpath} -nouser -nogroup -type f -exec ls -l {} \。find / -nouser –a -nogroup -a -atime -7。

-readable -writable -executable

-wholename PATTERN -size N[bcwkMG] -true -type [bcdpf] -uid N

-used N -user NAME -xtype [bcdpfls]

int fprintf(file *stream,char *format,arg_list)。 int fprintf(file *stream,char *format,arg_list)。int fprintf(file *stream, char*format, )。

starting mysql..manager of pid-file quit without updating file.[failed]。fls - faro ls。 factor file or fprint audit tool file。

-exec COMMAND ; -exec COMMAND {} + -ok COMMAND ;

-execdir COMMAND ; -execdir COMMAND {} + -okdir COMMAND ;

Report (and track progress on fixing) bugs via the findutils bug-reporting

page at or, if you have no web access, by sending

email to .

本文来自电脑杂谈,转载请注明本文网址:

http://www.pc-fly.com/a/ruanjian/article-118150-1.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值