I'm having some trouble with this command under bash in Ubuntu:
rm $(find . -name "*.exe")
My aim is to remove, recursively, all files ending in .exe
. But some files have white spaces and this breaks the command.
Any suggestions on how to approach this problem?
Best Answer
This has
find
format the command and arguments, and it carefully avoids mangling the names (by passing each one as a separate argument torm
). The '+' means "do as many as you can reasonably in one execution ofrm
".