find(1) ./dist -empty -type d -delete
search for files in a directory hierarchy
find [-H] [-L] [-P] [-D debugopts] [-Olevel] [path...] [expression]
-empty File is empty and is either a regular file or a directory.
-type c
       File is of type c:

       b      block (buffered) special

       c      character (unbuffered) special

       d      directory

       p      named pipe (FIFO)

       f      regular file

       l      symbolic link; this is never true if the -L option or the  -follow  option  is  in  effect,
              unless the symbolic link is broken.  If you want to search for symbolic links when -L is in
              effect, use -xtype.

       s      socket

       D      door (Solaris)
ACTIONS
    -delete
           Delete  files;  true if removal succeeded.  If the removal failed, an error message is issued.  If
           -delete fails, find's exit status will be nonzero (when it  eventually  exits).   Use  of  -delete
           automatically turns on the -depth option.

           Warnings:  Don't  forget  that  the  find  command  line is evaluated as an expression, so putting
           -delete first will make find try to delete everything below the  starting  points  you  specified.
           When  testing a find command line that you later intend to use with -delete, you should explicitly
           specify -depth in order to avoid later surprises.  Because  -delete  implies  -depth,  you  cannot
           usefully use -prune and -delete together.
source manpages: find