I'm trying to delete all empty folders within a directory. However,
find . -type f -empty does not find anything because every folder contains a hidden
How can I work around this?
If you can, you can off course first remove all
If that's not possible, I would go with scripting route:
First try test-run, because there might be something surprising. Then you can change
Note however, this will remove all folders with only dot-files (so for example
Minor modification (simply print the directory and pipe into
Put this somewhere in your
to list which directories it found (modify list if necessary) and then pipe into
This script has become very useful to me while using
I just stumbled upon this and I used this script but modified it to properly consider empty dirs only the ones with .svn and no other file, hidden or normal.
Also, bear in mind that I am using svn rm, so this is suppose to work against a repository, you could adapt the script to do something different on the directory.