首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Unix查找-mtime {负值或正值}

Unix查找-mtime {负值或正值}
EN

Stack Overflow用户
提问于 2014-12-30 06:57:37
回答 3查看 7.3K关注 0票数 6

find -mtime -4find -mtime +4是做什么的?我无法理解手册中给出的例子。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2014-12-30 07:06:51

根据手册页:

代码语言:javascript
复制
-mtime n
    File’s  data was last modified n*24 hours ago.  See the comments
    for -atime to understand how rounding affects the interpretation
    of file modification times.

-mtime的参数被解释为文件使用期间的一整天数。-mtime +n的意思是严格地大于,-mtime -n的意思是严格地小于。

所以在你的情况下

-4的意思是少于4天。

+4的意思是超过4天,即4*24小时。

票数 9
EN

Stack Overflow用户

发布于 2014-12-30 07:01:17

嗯,我可以。

-mtime n 文件的数据上一次修改是在24小时前。请参阅-atime的注释,以了解舍入如何影响文件修改时间的解释

代码语言:javascript
复制
find . -mtime 0   # find files modified between now and 1 day ago
                  # (i.e., within the past 24 hours)
find . -mtime -1  # find files modified less than 1 day ago
                  # (i.e., within the past 24 hours, as before)
find . -mtime 1   # find files modified between 24 and 48 hours ago
find . -mtime +1  # find files modified more than 48 hours ago
票数 11
EN

Stack Overflow用户

发布于 2020-11-06 16:55:03

我的搜索--不管是“否定”、“时间”、“严格”--都没有在手册页找到规范文本,但它就在那里,oy,一刻不停:

代码语言:javascript
复制
   Numeric arguments can be specified as

   +n     for greater than n,

   -n     for less than n,

   n      for exactly n.

但是,当谷歌的头号竞争对手是堆栈溢出时,谁需要这个手册页呢?@SMA和@wgitscht已经给出了正确的答案。好吧,很高兴知道这是法律上的,而不是一个愉快的意外。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27700943

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档