Find and remove all empty directories using the Linux command line

In order to find and remove all empty subdirectories in the current directory (.) recursively, use this command:

find . -depth -type d -print0 | xargs -0 rmdir

This command will **only remove empty directories!**Any file or non-empty directory won’t be modified.

Explanation of what the parts mean: