我试图find我的计算机上创build一个特定的文件前1小时和1小时后创build的文件。
这是我试过的方法 –
find /root -newermt "2012-10-04 1800" -and -newermt "2012-10-04 2000" -exec ls -ldb {} \;
我的linux上的目录是root,创build的特定文件是在19:00创build的
这是另一种方法,我试过哪些工作,但它只显示一个结果之后或之前不是两个! >
find /root/Downloads -type f \( -newer /root/Downloads/alex.txt ! -newer /root/Downloads/hesham.txt \)
你要:
# missing a -not here ---------------------v find /root -newermt "2012-10-04 1800" -and -not -newermt "2012-10-04 2000" -exec ls -ldb {} \;
这样做:
/root
所有文件 这可能不是最有效的解决方案,但..
touch / tmp / temp -t文件创建时间 – 1小时
touch / tmp / ntemp -t文件创建时间+ 1小时
找 。 -newer / tmp / temp -a! -newer / tmp / ntemp -exec ls -l {} \; 2>的/ dev / null的