1

How to delete all files found by this command?

find -type f -name "*-thumb.png"
  • 4
    man find --> look for delete – Marki Dec 27 '14 at 22:23
3
find -type f -name "*-thumb.png" -exec rm {} \;

If you need a prompt to confirm deletion, use -ok in place of -exec as:

find -type f -name "*-thumb.png" -ok rm {} \;
1

find -type f -name "*-thumb.png" -delete

Will work as well. I use it very often after merge resolutions on Git to remove the ".orig" files that Git creates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.