You just forgot to close the quoted string with a "
after ".ppm
.
The >
you see is Bash's secondary prompt, as defined by the $PS2
environment variable. You get it when you input a command fragment that is supposed to continue (like e.g. because it has an unclosed quoted string or a missing done
or fi
keyword...) but press Enter to make a line break.
Another thing is that -iname ".png"
would only (case insensitively) match files with the exact name ".png". What you want is to match all files ending with ".png", so the condition must be -iname "*.png"
instead. Same for ".ppm" of course.
So the correct find
command would be:
find . -type f \( -iname "*.png" -o -iname "*.ppm" \) -exec rm {} \;
However, I'd usually recommend dry-running it without the -exec rm {} \;
first and check the list of files again for correctness, before actually letting it delete stuff without further confirmation.
Also, as correctly pointed out in the comments, you can and probably should replace -exec rm {} \;
with -delete
to let find
handle the deletion internally.