I would like to clean up some folders. So I want to delete all folders which are empty or only contain other folders...
First I tried
find . -type d -delete
but this lists the subfolders after the parents, so I would have to execute it multiple times.
So I tried using tac and pipes
find . -type d | tac | xargs rmdir
This one fails on whitespaces, etc, so I need a masking - now I am stuck...