Linux - disk usage (du) human readable and sorted by size
http://www.earthinfo.org/linux-disk-usage-sorted-by-size-and-human-readable/
This is quick tip to fix a problem that has always bugged me - When showing disk usage in a human readable form (KB, MB, GB) for each subdirectory using “du -sh *”, how can you properly sort it into size order?
(
2 comments
| 25 points
| on HN
)
du -s * 2>/dev/null | sort -n | cut -f2 | xargs du -sh 2>/dev/null