我在目录new中有以下文件:
Dec 14 04:35 New_folder
Dec 13 05:50 abc.sh
Dec 13 06:33 ashutosh.txt
Dec 13 06:40 delete.sh
Dec 13 07:19 test.bat
Dec 14 04:44 test.sh
Dec 14 04:30 xyz.sh并运行以下命令
find /test/new/ -type f -mtime +1根据这个命令的定义,我将在12月14日运行时,得到所有在一天以上的文件,但是输出中没有任何文件。
什么是有效的命令行?
发布于 2016-12-14 10:41:59
find循环到最近的24小时;这包括您的所有文件:
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.要检查这一点,请在其中一个文件上尝试touch -t:
touch -t 12011200 abc.sh如果您重新运行find命令,现在应该会看到abc.sh (因为您的touch命令将abc.sh的最后访问/修改时间设置为12月1日12:00)。
https://unix.stackexchange.com/questions/330278
复制相似问题