Created
June 4, 2013 21:22
-
-
Save trinitronx/5709708 to your computer and use it in GitHub Desktop.
Script to sort disk usage output by size
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
#!/bin/bash | |
# This line sorts first according to numerical size in bytes | |
# the second pass through du in the while loop converts to human readable | |
# format | |
du -s * | sort -n | cut -f 2- | while read a; do du -hs "$a"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment