Is there a quick way of deleting all the .pyc files from a tree of directories?
If you’ve got GNU find then you probably want
find <directory name> -name '*.pyc' -delete
If you need something portable then you’re better off with
find <directory name> -name '*.pyc' -exec rm {} ;
If speed is a big deal and you’ve got GNU find and GNU xargs then
find <directory name> -name '*.pyc' -print0|xargs -0 -p <some number greater than 1> rm
This is unlikely to give you that much of a speed up however, due to the fact that you’ll mostly be waiting on I/O.
Check more discussion of this question.