Delete files WITHIN 7 days. Example. files extracted a few minutes ago and you no longer need them. Ideally, replace the "." with full path.
find . -name "*" -mtime -7 -exec rm {} \;
#more than 7 days. This is for files you want to keep in last 7 days and do not want to keep anything that are longer than 7 days.
find . -name "*" -mtime +7 -exec rm {} \;
No comments:
Post a Comment