Skip to main content
Tweeted twitter.com/#!/StackUnix/status/42726698092986369
edited tags
Link
Gilles 'SO- stop being evil'
  • 865.3k
  • 205
  • 1.8k
  • 2.3k
Source Link
maaartinus
  • 5.2k
  • 8
  • 32
  • 30

How to remove all empty directories in a subtree?

How can I remove all empty directories in a subtree? I used something like

find . -type d -exec rmdir {} 2>/dev/null \;

but I needs to be run multiple times in order to remove directories containing empty directories only. Moreover, it's quite slow, especially under cygwin.