Linux Daily Tip – Bulk Delete Files By Name

Ever find yourself tediously removing files by hand, across a large, complex directory structure? Luckily, there’s a simply, easy way to delete files, as long as they have a part of their name in common.

For example, to delete all PDF files in this directory, recursively, run

find . -name "*.pdf" -exec rm -f {} \;

Leave a Reply

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