Skip to content

Instantly share code, notes, and snippets.

@glyphobet
Created July 21, 2011 04:59
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 glyphobet/1096527 to your computer and use it in GitHub Desktop.
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
#!/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