Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unix find -mtime {a negative or postive value}

What do find -mtime -4 and find -mtime +4 do? I cannot understand the examples given in the man page.

like image 523
Unixbun Avatar asked Dec 30 '14 06:12

Unixbun


1 Answers

Well, I can.

-mtime n

File's data was last modified n*24 hours ago. See the comments for -atime to understand how rounding affects the interpretation of file modification times

find . -mtime 0   # find files modified between now and 1 day ago
                  # (i.e., within the past 24 hours)
find . -mtime -1  # find files modified less than 1 day ago
                  # (i.e., within the past 24 hours, as before)
find . -mtime 1   # find files modified between 24 and 48 hours ago
find . -mtime +1  # find files modified more than 48 hours ago
like image 62
wgitscht Avatar answered Sep 28 '22 06:09

wgitscht