Take the 2-minute tour ×

How can I search files modified in a specific day ?

share|improve this question

migrated from stackoverflow.com Dec 5 '10 at 7:07

This question came from our site for professional and enthusiast programmers.

man find -- find <path> -mtime <n> where n is the number of days to that specific day –  bjoernz Dec 2 '10 at 8:54
add comment

2 Answers

Figure out how many days ago that was, and use it without a sign in -mtime.

share|improve this answer
add comment
 touch --date "2010-11-01" /tmp/foo(some temp file which is not important)
 touch --date "2010-11-02" /tmp/foo2(some temp file which is not important)
 find /some_folder -newer /tmp/foo ! -newer /tmp/foo2

This gives you the files in some_folder which are modified newer than or the same date to "2010-11-01" and not newer than "2010-11-02".

share|improve this answer
You forgot to create a second file with a date a day later and invert the search on it. –  Ignacio Vazquez-Abrams Dec 2 '10 at 9:05
I've fixed it and added a newer date boundary. –  miette Dec 2 '10 at 11:43
add comment

Your Answer


