I want to cleanup a directory (and subdirectories) from each occurrance of the .py
and .pyc
files. I tried the following
find . -name '*pyc' -o -name '*py~' -exec rm -f {} \;
which left out all pyc
files. When doing
find . -name '*pyc' -o -name '*py~'
the command finds the pyc
files, which are not deleted, whatsoever. Any insights?
-delete
is not a standard option. By all means, use it if yourfind
supports it, but don't use it in scripts that are meant to be portable. – Stéphane Chazelas Apr 04 '13 at 17:56find
is a lot like Perl. Amazingly powerful, but write-only. – Plutor Apr 04 '13 at 22:43