How to find and delete empty folders in Linux

Using the find command in Linux you can add options to find empty folders and also to delete them if required

Find:

find . -empty -type d 

Delete:

find . -empty -type d -delete

Justin Kelly

Justin Kelly

Web Developer, Business Analytics, Data Engineer specialising in PHP and Tableau

Based in Melbourne, Australia

Feel free to contact me justin@kelly.org.au or _justin_kelly

Leave a comment

Name Notify me of replies by email.