Be careful as these are powerful commands which blow away files completely.
Note:
To find files modified more than 5 days use -mtime +5 and files modified less than 5 days use -mtime -5
Note:
To find files modified more than 5 days use -mtime +5 and files modified less than 5 days use -mtime -5
Use -ctime parameter to find out the created time
To List and Delete log files older than 10 days, execute the following commands
find /var/log/ -name *.log -mtime +10 -exec ls -tl {} \;
find /var/log/ -name *.log -mtime +10 -exec rm -f {} \;
find /var/log/ -name *.log -mtime +10 -exec ls -tl {} \;
find /var/log/ -name *.log -mtime +10 -exec rm -f {} \;
By Suresh : rm -rf *.[0-9]