Bash – How to remove all .pyc files from a project


I've renamed some files in a fairly large project and want to remove the .pyc files they've left behind. I tried the bash script:

 rm -r *.pyc

But that doesn't recurse through the folders as I thought it would. What am I doing wrong?

Best Solution

find . -name "*.pyc" -exec rm -f {} \;