Created
July 21, 2011 04:59
-
-
Save glyphobet/1096527 to your computer and use it in GitHub Desktop.
Remove emacs poop and cruft lying around from mounting Linux filesystems on Mac OS X over sshfs
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
#!/usr/bin/env python | |
import sys | |
import os | |
import os.path | |
for a in sys.argv[1:]: | |
for root, dirs, files in os.walk(a): | |
for f in files: | |
if f.startswith(':2e_') or f.startswith('._') or f.endswith('~') or f == '.DS_Store': | |
print "rm %r" % os.path.join(root, f) | |
for d in dirs: | |
if d == '.AppleDouble' or d == '.AppleDB': | |
print "rm -r %r" % os.path.join(root, d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment