Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Kudos for the most succinct answer by using find's own built-in delete! I am adding this to my local utilscripts! Commented Sep 19, 2014 at 2:26
  • Simplest, and the explanation about -delete implying -depth removes any lingering doubt. Thanks! Commented Feb 11, 2021 at 12:25
  • Not working on some BusyBox limited versions of find that don't include the -empty flag . Commented Mar 4 at 20:31