Skip to content

Instantly share code, notes, and snippets.

@mfessenden
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfessenden/331a67320941e53b38e8 to your computer and use it in GitHub Desktop.
Save mfessenden/331a67320941e53b38e8 to your computer and use it in GitHub Desktop.
recursively clean a directory of *.pyc, autosave files
#!/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