#!/usr/bin/python import os,sys # Removes all empty files in the directory given as the argument print "Cleaning up %s" %sys.argv[1] path = sys.argv[1] os.chdir(path) for f in os.listdir('.'): if os.path.isfile(f) and os.path.getsize(f) == 0: os.remove(f)