I have configure log rotate on my apache access logs. It make zip file on end of day. Day by day its increasing n I don’t have space to keep all logs.
I want to delete 7 days old zip files from that folder.
# cd /usr/local/apache2/logs/
# find . -name “*.zip” -mtime +7| xargs rm -fv
Explanation of command.
find . — means find in present directory
-name “*.zip” — find files which ends with .zip extension
-mtime +7 —means search files before last 7 days
| xargs rm -fv — this means it will get the output of find command & process it using rm command