Skip to content
SumGuy's Ramblings
Go back

recursively delete all empty subdirectories

find /home/user/somedir -depth -type d -empty -exec rmdir -v {} \;

Caution!

This CAN and WILL destroy all your data and eat your small { dog | cat | turtle | parrot } if you aren’t careful! ALWAYS check the path twice and then check it again before using.


Share this post on:

Previous Post
SSH key generation 101
Next Post
Directory FileCount