I started with this based off of another question I had:
find -type f -iname '*.png' -exec rm
that clearly didn't work, but am I atleast warm?
I started with this based off of another question I had:
find -type f -iname '*.png' -exec rm
that clearly didn't work, but am I atleast warm?
You were very close:
find -type f -iname '*.png' -exec rm {} \;
As edwinksl pointed out, using -delete
flag also works:
find -type f -iname '*.png' -delete
In bash
shell alone we can do
shopt -s globstar
rm ./**/*.png
This, however, might suffer from Arguments list too long
error, if number of files expanded is large, or environment passed to the command is also large. As always, remember to append echo rm ./**/*.png
to see what will actually run.
-exec rm
part with-delete
. – edwinksl Jan 03 '17 at 00:44