Friday, July 22, 2022

[SOLVED] How do I remove all .pyc files from a project?

Issue

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?


Solution

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


Answered By - Bill the Lizard
Answer Checked By - Terry (WPSolving Volunteer)