35 pts.
 how to remove 7 days back files using unix
how to remove 7 days back files using unix

Software/Hardware used:
unix
ASKED: February 22, 2010  7:59 AM
UPDATED: February 22, 2010  2:43 PM

Answer Wiki:
<pre># find $DIR -atime +7 -exec rm {} ;</pre>
Last Wiki Answer Submitted:  February 22, 2010  2:26 pm  by  ITKE   16,755 pts.
All Answer Wiki Contributors:  ITKE   16,755 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Well, I’m not native English speaker and it’s not quite clear to me what means “remove 7 days back files” – files older than 7 days, or files created during the last 7 days?

OK, one will “only” change the sign of mtime argument (and better do it before running find with -exec rm…)

I’d also like to mention -mmin parameter to find: granularity will increase from days (mtime, ctime) to minutes ( mmin, cmin)

Good luck,

Petko A.

 3,120 pts.