[K12OSN] 100 Largest Files

Calvin Dodge caldodge at gmail.com
Sun May 18 18:21:15 UTC 2008

2008/5/18 Mel Wade <mel at melwade.com>:
> Is there a way to scan a hard drive and list the 100 largest files using the
> command line in Linux?

find / -mount  -type f -print0|xargs -0 du -s >/root/$$.sort;sort -n
/root/$$.sort|tail -n 100

(-mount keeps it from searching /proc and the like)

This is piped to a temporary file because xargs will cut the filename
list into 128 KB chunks.


More information about the K12OSN mailing list