http://qs321.pair.com?node_id=1209349


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)