Using bash to find a file modified in a specific date/time interval?

Did you ever need to find a file stored somewhere in a bunch of folders, which you didn’t remember the name, but you remember about when you last modified the file? At work, it sometimes happens that I need to find some log file, among 20 Gigs of log files, which was modified on a certain day. Here is a simple bash trick to do just that:

 touch -d "13 october 2006 15:00:00" ~/date_start
 touch -d "14 october 2006 21:00:00" ~/date_end
 find some/path -newer ~/date_start -and -not -newer ~/date_end
Facebook Twitter Email