Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Recursively removes 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
# or, for copy-pasting:
# find . | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.