How to find empty folders on Linux

Posted on October 17, 2008

advertisement

Tips: How to find an empty folders on Linux box

In order to do some folder maintenance job, you may require to find an empty folder on Linux box. I would like to share tips here:

# find /path -type d -empty

Find empty folder and list
# find /path -type d -empty -exec ls -ld {} \;

Find empty folder and save as temporary file
# find /path -type d -empty -exec ls -ld >> /tmp/savefiles.txt {} \;

Find empty folder and delete
# find /path -type d -empty -exec rm -rf {} \;

Enjoy!

Possibly Related Posts:


Comments

One Response to “How to find empty folders on Linux”

  1. waike on October 23rd, 2008 3:17 pm

    you can easily found tons of similar tutorial.

Leave a Reply




Planet Malaysia

  • Follow us on Twitter


  • web www.planetmy.com