tinyapps.org / blog

Delete empty directories recursively #

A tiny Windows app for this purpose was mentioned a few years ago, but here are the Linux and OS X commands to recursively delete empty directories below the current one (use at your own risk, as the slightest mistake WILL destroy all of your data):
Linux: find -depth -type d -empty -exec rmdir {} \;
OS X: find ./ -depth -type d -empty -exec rmdir {} \;

/nix | Nov 07, 2007

Subscribe or visit the archives