> 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:
> find . -empty -delete
simple, no?
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).
> for file in $( ls . ); do if [ ! -s $file ]; then rm -f $file; fi; done
> find . -empty -delete
No comments:
Post a Comment