Created
July 28, 2010 13:57
-
-
Save chrischambers/494601 to your computer and use it in GitHub Desktop.
This file contains 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
cleanup () { | |
find ./ -name '*~' -or -name '*.pyc' -or -name '#*#' -or -name '.*~' -or -name '.#*' | xargs rm -f | |
clear | |
} | |
# The previous cleanup function is potentially dangerous in an environment where you could have filenames with spaces. | |
# The safest pattern when using the find... xargs combo is to use null-terminators for filenames, i.e. | |
`find ... -print0 | xargs -0 ...`: | |
cleanup () { | |
find . -type f -name '*~' -or -name '*.pyc' -or -name '#*#' -or -name '.*~' -or -name '.#*' -print0 | xargs -0 rm -f | |
clear | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment