Tec(h)tonic

Insights into building a solid I.T. foundation in the mid-size business world.

Delete empty directories in *nix

find <directoryPath> -type d -empty | xargs rmdir

Or, alternatively:

find <directoryPath> -empty -type d -delete
(note that the -delete option implies -depth)


Leave a Reply

Your email address will not be published. Required fields are marked *