Finding big files and directories on a Linux system

techie-iconTo find big files on a Linux system, try:

find . -type f -print0 | xargs -0 du -s | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}

To find big directories on a Linux system, try:

find . -type d -print0 | xargs -0 du -s | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}

The tail -10 on each of those controls how many you’ll see, so if you wanted to see the 20 biggest you’d change that to tail -20.

Leave a Reply