Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to find all folders within a given folder that contain no files (but folders are ok). This needs to be recursive - it looks in all child folders.

I can find folders that are completely empty using the Number if Items search criteria set to less than 1. However, this does not return folders that have other folders inside them.

I am basically trying to delete folders that had files in that I have deleted the contents from using a previous search.

share|improve this question

Here is a terminal command

find . -type d -empty

And if you want to delete these files :

find . -type d -empty -delete
share|improve this answer
That finds empty directories in the current working directory, but not empty directories inside it. How do I make this recursive? – dunxd Jan 20 '13 at 1:40
It turns out that the folders have some hidden files in, so they aren't returned at all with this command :-( – dunxd Jan 20 '13 at 1:42
@dunxd If they are .DS_Store files, you can delete them with find ~/Folder -name .DS_Store -delete. – user495470 Jan 20 '13 at 14:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.