Quickzi: How To Show The Top Largest Files and Directories
Saturday, April 19th, 2008 at
7:19 am
Here is a quick tip on how to display the top largest files and directories within my home directory:
# du -hs /home/adam/* | sort -nr | head
Cheers!
Popularity: 5% [?]
Tagged with: HowTo • Linux • quickzi • tips • tricks
Like this post? Subscribe to my RSS feed and get loads more!













Just a note, it doesn’t work with the -h (human-readable units) flag if the file sizes are in different units (such as a 16 GB folder and a 599 MB folder) — it only sorts by the raw number, not taking into account the units (so the 599 MB folder would come before the 16 GB folder). If you remove the -h flag, it works fine. Cool trick though.
I believe this will do the same:
ls -1hSs /home/adam |head