remove ten days old log files in unix

February 17, 2011 at 18:19:19
Specs: unix
find . -name 'server.log.*' -type f -mtime +10 -exec ls -l {} \;

I have used this but its not working. Some one can assist me in correcting the cmd


See More: remove ten days old log files in unix

Report •

#1
February 17, 2011 at 22:41:18
It seems to work OK on my Solaris 9 box. I choose to use xargs instead of -exec because it's more efficient:

find . -name 'server.log.*' -type f |xargs ls -l

Of course, when you want to delete files it is:


find . -name 'server.log.*' -type f |xargs rm


Report •
Related Solutions


Ask Question