I would tackle this from the shell level, and think about a bash script to do this rather than Julia.
I would start by using the find utility, and my brain is saying recursion till you get to the leaves of the tree.
However I do not have the find fu aat this time in the morning.
find cn discover empty directories by
find -type d -empty
However you are looking for directories which contain one or more than one directory object
ps the tree utility will display your file tree structure nicely. Looks like you cannot do much with the output of tree
pps Think about what happens if you follow symbolic links. I would not follow links - you could end up stomping ll over a filesystem.
Also think about hidden files - make sure you find them
ppps I will be humiliated when someone points out this is Comp Sci 101 problem and you just recurse down the tree