Wednesday, September 29, 2010

How to remove files older than 5 day(s) ?

find . -mtime +5 -exec -print

find . -mtime +5 -exec rm {} \;

If list of files is long then use xargs option :-

find . -name ".log" -mtime +5 -exec xargs -0 rm {} \;

To list files older than some minutes :-

find . -type f -mmin +60 -print

No comments:

Post a Comment