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

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

$
0
0
find <dir> -mtime -20

this find command will find files modified within the last 20 days.

  • mtime -> modified (atime=accessed, ctime=created)
  • -20 -> lesst than 20 days old (20 exactly 20 days, +20 more than 20 days)

You acan add additional limitations like:

find <dir> -mtime -20 -name "*.txt"

the same as before, but only finds files ending with '.txt'.


Viewing all articles
Browse latest Browse all 12