Skip to content

Instantly share code, notes, and snippets.

@antonioiksi
Created December 18, 2018 17:42
Show Gist options
  • Save antonioiksi/f77cbd4f2ee4b7fc8196f79c0f2c0860 to your computer and use it in GitHub Desktop.
Save antonioiksi/f77cbd4f2ee4b7fc8196f79c0f2c0860 to your computer and use it in GitHub Desktop.
remove pycache in python projects
#!/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