This is mainly somewhere for me to dump interesting tidbits of tech info. Stuff that I may forget but will need again in the future. For a proper blog, visit my electronics blog (http://www.fangletronics.com) or my wife's pre-school crafty blog (http://www.filthwizardry.com).
Tuesday, May 18, 2010
delete all empty files in a directory
Automatically generating files? Annoyed at all the empty ones? Here's how to purge them:
> for file in $( ls . ); do if [ ! -s $file ]; then rm -f $file; fi; done
Of course you could just get over your fear of find and take a look at that man page. Perfect for a recursive search and delete all in one:
No comments:
Post a Comment