Last active
August 29, 2015 14:24
-
-
Save mfessenden/331a67320941e53b38e8 to your computer and use it in GitHub Desktop.
recursively clean a directory of *.pyc, autosave files
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 | |
var="$1" | |
if [ -z "$var" ] | |
then | |
var="$PWD" | |
fi | |
echo "cleaning up directory: $var..." | |
FILES=`find $var -name "*.pyc" -or -name "*.orig" -or -name "~*" -or -name "*~"` | |
for filename in $FILES | |
do | |
rm -rfv $filename | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment