Find files older than 10 days in Linux and delete them

  

find -mtime:mtime indicates file modification time find -type f: indicates search file, exclude directory (d) and link (l)stat filename: view file status Touch -m -t “0507150202″ filename: update file update time, -t format is YYMMDDhhmm
//10 days ago, excluding the day 10 file $ find -mtime +10 -exec rm -rfv {} \\;//10 days ago, the day's file $ find -mtime 10 -exec rm -rfv {} \\;//10 days, including today's file, but not including the 10th day of the file $ find -mtime -10 -exec rm -rfv {} \\;

Copyright © Windows knowledge All Rights Reserved