How do I recursively remove empty directories?Category: Shell Tricks
As usual, there is more than one way to do it. If you have Perl's 'File::Find' module you can do it in a single thread:
perl -MFile::Find -e"finddepth(sub{rmdir},'.')"
Otherwise, you can use find to call rmdir. It just will go through lots of sub-threads and take longer:
find -depth -type d -empty -exec rmdir -v {} \;
|