Created
December 17, 2019 01:05
-
-
Save jsnfwlr/8756f418e72a65d1539c50d8e0820c23 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show the size of folders in current (non-recursive) | |
ls -1 | sed 's/ /\\ /g' | xargs du -sh | |
# show the size all folders below the current (recursive) | |
ls -1 | sed 's/ /\\ /g' | xargs du -h | |
# Remove empty folders - must be run a few times to work up the tree | |
ls -1 | sed 's/ /\\ /g' | xargs du -h | grep '4.0K' | awk '{$1=""; print $0}' | sed 's/^ //g; s/ /\\ /g' | xargs rm -rf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment