Python3 project remove __pycache__ folders and .pyc files

You can do it manually with the next command:

find . | grep -E "(/__pycache__$|\.pyc$|\.pyo$)" | xargs rm -rf

This will remove all .pyc and .pyo files as well as __pycache__ directories recursively starting from the current directory.

Leave a Comment