This is not a user-friendly aspect of find - you need to understand how matching really works in order to correctly define search criteria. The following explanation is based on GNU search (findutils) 4.4.2.
find tests -atime , -ctime , -mtime run for 24-hour periods, so set the "file age" to
floor (current_timestamp - file_modification_timestamp / 86400)
Given the three files modified 1 hour ago, 25 hours ago, and 49 hours ago
$ touch -t $(date -d "1 hour ago" +"%m%d%H%M") a.txt $ touch -t $(date -d "25 hours ago" +"%m%d%H%M") b.txt $ touch -t $(date -d "49 hours ago" +"%m%d%H%M") c.txt
file ages (as defined above)
$ echo "($(date +"%s") - $(stat -c %Y a.txt)) / 86400" | bc 0 $ echo "($(date +"%s") - $(stat -c %Y b.txt)) / 86400" | bc 1 $ echo "($(date +"%s") - $(stat -c %Y c.txt)) / 86400" | bc 2
Given the above, here's what it finds
$ find -type f -mtime 0
This shows that -mtime 0 and -mtime -1 give equivalent results.
-mmin gives the same test with finer granularity - the argument is minutes instead of 24-hour periods.
I cannot reproduce your problem using the above version of find
$ touch tmp.txt $ find * -mtime 0 tmp.txt $ find * -mtime -1 tmp.txt
vilpan
source share