Remove files by date using Linux Command Line

This command allowed me to remove all files in a directory that where older than 30 days.

rm -f  `find *.gz -type f -mtime +30`

You can see what you’ll be deleting first by running this command.

echo `find *gz -type f -mtime +30`

Leave a Reply

Your email address will not be published. Required fields are marked *