Skip to main content

All The Info

  • Home
  • 2006 Colorado Blizzard
  • Car hits the house
  • Favorite Quotes
  • San Diego 2006
  • Stupid Google Tricks

Category: find

How to use the find command.

Finding Empty Directories With Bash

March 26, 2007March 26, 2007 Bob Weber

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

Pages

  • 2006 Colorado Blizzard
  • All The Info 2.0
  • Car hits the house
  • Circles Test
  • Favorite Quotes
  • Greeley Dining Reviews
  • Lifestream
  • Lifestream
  • Linux Tips
    • Bash
    • Log files
    • Slackware Tips
    • Syslog
    • Useful Linux Commands
    • xf86 or xorg tips
  • Picture Album
  • San Diego 2006
  • Sauer M38H
  • Stupid Google Tricks
  • Web Development
    • Server Response Codes
All The Info All rights reserved. Theme by Colorlib Powered by WordPress