Posts Tagged ‘du’

Finding large files and directories on Linux

Monday, August 25th, 2008

Use this simple command to find large directories. To find directories over 1GB

[root@localhost]# du -h / | grep ^[0-9\.]*G

G can be replaced with M if looking for MB instead.

To find directories over 10GB and sort the output with the largest directories on top

[root@localhost]# du -h / | grep ^[1-9][0-9][0-9\.]*G | sort -rn

(more…)

How To Show The Top Largest Files and Directories

Friday, June 6th, 2008

Here is a quick tip on how to display the top largest files and directories within my home directory:

# du -hs /home/userid/* | sort -nr | head