I have a bunch of nested folders. Most folders contain files. Some contain hundreds of thousands of files. Some are empty.
I want to get a list of all empty folders. However, when I run:
find -type d -empty
it takes a very long time to run, a lot longer than it takes to run just find -type d
. I suspect that -empty
is checking all files to see if they are empty, then -type d
is skipping the files.
So is there:
1) a way to optimize find so that it will a) find all folders, then b) list the empty ones?
or
2) a different command (or commands) that I could use to get this list?