简体   繁体   English

ubuntu:查找在特定日期更改的所有文件

[英]ubuntu: find all files changed at certain date

I would like to get list of all files changed at certain date (eg 11.1.2012) in Ubuntu.我想获取 Ubuntu 中特定日期(例如 11.1.2012)更改的所有文件的列表。

find -mtime

works for days before, but I want files from exactly one day and want to do it more comfartable than by counting days back.几天前工作,但我想要恰好一天的文件,并且希望这样做比倒数几天更舒适。 Is there any way to do so?有什么办法吗?

Thank you very much.非常感谢你。

you can use a little trick.你可以使用一个小技巧。 Use the touch command to create two files with a modification date that includes the date you're searching for.使用touch命令创建两个文件,其修改日期包括您要搜索的日期。

Example:例子:

touch -t 201204080000 dummy1触摸-t 201204080000 dummy1

touch -t 201204082359 dummy2触摸-t 201204082359 dummy2

then you can use find as follows:然后你可以使用find如下:

find /somedir/ ( -newer dummy1 -and ! -newer dummy2 )找到/somedir/(-newer dummy1 -and !-newer dummy2)

This should work out well.这应该很有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM