Skip to content

Instantly share code, notes, and snippets.

@hbsdev
Forked from joelverhagen/clean_py.sh
Last active November 11, 2025 17:52
Show Gist options
  • Save hbsdev/a17deea814bc10197285 to your computer and use it in GitHub Desktop.
Save hbsdev/a17deea814bc10197285 to your computer and use it in GitHub Desktop.
Recursively remove all .pyc files and __pycache__ directories in the current directory.
#!/bin/sh
# recursively removes all .pyc files and __pycache__ directories in the current
# directory
find . | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf
@gnanaprakash2918
Copy link

gnanaprakash2918 commented Nov 11, 2025

For Windows Powershell Use this :
Get-ChildItem -Path . -Recurse -Include '__pycache__', '*.pyc' | Remove-Item -Recurse -Force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment