Created
January 16, 2015 21:48
-
-
Save peter-stratton/c127d6df835290261027 to your computer and use it in GitHub Desktop.
Python *.pyc and __pycache__ recursive cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo | |
echo `find . -type f -iname \*.pyc -not -path "./.*"` | |
echo `find . -type d -name __pycache__ -not -path "./.*"` | |
echo | |
read -p "Delete these files (y/n)? " RESP | |
case "$RESP" in | |
y|Y ) find . -type f -iname \*.pyc -not -path "./.*" -delete && find . -type d -name __pycache__ -not -path "./.*" -delete;; | |
n|N ) echo "Exiting without deleting anything.";; | |
* ) echo "invalid";; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment