Quantcast
Channel: Linux: using find to locate files older than - Server Fault
Viewing all articles
Browse latest Browse all 12

Answer by Dennis Williamson for Linux: using find to locate files older than

$
0
0

No, you can use a date/time string.

From man find:

-newerXY reference
Compares the timestamp of the current file with reference. The reference argument is normally the name of a file (and one of its timestamps is used for the comparison) but it may also be a string describing an absolute time. X and Y are placeholders for other letters, and these letters select which time belonging to how reference is used for the comparison.

          a   The access time of the file reference          B   The birth time of the file reference          c   The inode status change time of reference          m   The modification time of the file reference          t   reference is interpreted directly as a time

Example:

find -newermt "mar 03, 2010" -lsfind -newermt yesterday -lsfind -newermt "mar 03, 2010 09:00" -not -newermt "mar 11, 2010" -ls

Viewing all articles
Browse latest Browse all 12