linux - 用mtime查找不起作用

标签 linux bash shell find

我在家里创建了一个文件夹,并且触摸了里面的一个文件。现在我正在执行

find /home -mtime 1

但什么也没找到。这正常吗?

最佳答案

您需要使用:

find /home -mtime -1

根据man find:

-mtime n[smhdw]
    If no units are specified, this primary evaluates to true if the difference between 
    the file last modification time and the time find was started, rounded up to the next 
    full 24-hour period, is n 24-hour periods.

    If units are specified, this primary evaluates to true if the difference between the 
    file last modification time and the time find was started is exactly n units. 

关于linux - 用mtime查找不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26561983/

相关文章:

c - 写入 emacs 时进程有时会暂停

c++ - bash 脚本在使用 popen() 时不将返回码返回给调用 C++ 程序

linux - 循环文本文件和 grep

bash - 在bash中读取和解析文件及其参数

bash - bash 脚本中的参数错误太多

linux - bash 管家脚本需要权限才能删除文件夹中的不同文件夹和文件

linux - 创建文件 shell 脚本

php sleep 与 bash sleep

perl - 为什么使用Perl系统函数执行命令时移位 "$? >> 8"位

c - 如何使用c程序查找我的机器是16位、32位还是64位