Linux命令检查文件系统中的新文件 [英] Linux command to check new files in file system
问题描述
我们有linux机器,我们想检查在特定日期范围内添加了哪些新文件.
We have linux machine we would like to check what new files have been added between a certain date range.
我只有SSH访问此框,它是openSUSE 11.1
I only have SSH access to this box and it's openSUSE 11.1
是否存在某种命令,可以给我提供在2011年4月5日至2011年5月5日之间已添加到文件系统中的文件的列表
Is there some sort of command that can give me a list of files that have been added to the filesystem between say 04/05/2011 and 05/05/2011
谢谢
问候 加布里埃尔
推荐答案
有很多方法可以做到这一点.
There are bunch of ways for doing that.
第一个:
start_date=201105040000
end_date=201105042359
touch -t ${start_date} start
touch -t ${end_date} end
find /you/path -type f -name '*you*pattern*' -newer start ! -newer end -exec ls -s {} \;
第二个: 查找20到21天前修改过的文件:
Second one: find files modified between 20 and 21 days ago:
find -ctime +20 -ctime -21
查找在2500到2800分钟前修改的文件:
finds files modified between 2500 and 2800 minutes ago:
find -cmin +2500 -cmin -2800
并阅读本主题.
这篇关于Linux命令检查文件系统中的新文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!