1

How to delete all files found by this command?

find -type f -name "*-thumb.png"
clarkk
  • 1,837

2 Answers2

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 {} \;
Ketan
  • 9,226
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.

Darlan Alves
  • 111
  • 2
  • Just be very careful because of this: http://unix.stackexchange.com/questions/150628/why-does-find-delete-delete-all-files-in-a-directory-recursively?rq=1 – Darlan Alves Dec 28 '14 at 21:32