Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Clean Up Empty Directories

by choroba (Archbishop)
on Feb 16, 2018 at 23:35 UTC ( #1209349=note: print w/replies, xml ) Need Help??

in reply to Clean Up Empty Directories

I usually just run
find -type d -empty -exec rmdir {} +
several times until there's no empty directory.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Clean Up Empty Directories
by Anonymous Monk on Feb 18, 2018 at 16:17 UTC

    GNU find has a -delete action. It implies -depth and as such, can do the clean-up in one go.

Re^2: Clean Up Empty Directories
by GotToBTru (Prior) on Feb 19, 2018 at 19:25 UTC

    I'm pretty sure the command that does the file cleanup is a find command somewhere. I think that there should have been a way to write it such that it cleaned out the directories too.

    But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1209349]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2020-09-29 08:03 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (146 votes). Check out past polls.