Find and delete emtpy directories in linux

Posted by Dark Training on May 12, 2009 tags: | linux | bash

If you have a directory that has many empty folders just taking up space, you can use the following command to clear the empty directories recursively.

find /path -depth -type d -empty -exec rmdir {} \;

In short that looks in /path for directories that are empty then executes the command rmdir.