Recursively Delete Files by Extension

Posted by & filed under Linux.

Run this command to recursively delete files based on the provided extension (e.g. log): find . -type f -name “*.log” -exec rm -f {} \; You can remove everything after -exec (inclusive) to print the matched files to the screen (as a test run). You can change the . to be whatever directory you want… Read more »