Finding Empty Directories With Bash

Needed to find some empty directories today, so I ran a google search and found this excellent example of using find to locate (and delete) empty directories.

find -depth -type d -empty -exec rmdir {} ;

Actually, all I wanted was this:

find -depth -type d -empty

Parameters are as follows:

-depth — start at the deepest point
-type d — limit to directories
-empty — find empty directories

Bob Weber

My name is Bob Weber and I live in Greeley Colorado. This blog is my personal views, ideas, comments, etc.. You will probably learn more about me by reading the entries here than you will in this bio.