find unused files and delete them

find /var/log/radius/radacct -type f -name "reply*" -mtime +60 -exec rm -rf {} \;

-mtime N — more than N days without being edited
-exec CMD {} \; — comands, {} means the files which be found.

This entry was posted in Linux, Shell Script. Bookmark the permalink.