User Tools

Site Tools


linux:sysadmin:disk_usage

Disk Usage

For storage management see here.

Check disk usage in a specific directory

Get an overview about available disk space on the system

df -h

Show how much space the directory /home/www and its subdirectories are using

du -hcs /home/www

or…

du -hc --max-depth=1 /home/www

Search for big files and directories

Finding all large directories – For example find all directories taking 50k (kilobytes) blocks of space. This is useful to find out which directories on system taking lot of space.

find / -type d -size +50k

Finding all large files over 20000 KB:

find / -type f -size +20000k

Find big files in /usr and list them with ls:

find /usr -type f -size +20000k -exec ls -alh {} \;

Find big files everywhere but in /var and list them:

find / -type f -size +20000k -exec ls -alh {} \; | grep -v /var*

Restrict the search on a single mount point:

find / -mount -size +800k -type f -printf "%k %p %\n"
/srv/wiki.niwos.com/data/pages/linux/sysadmin/disk_usage.txt · Last modified: 2010/08/05 09:13 (external edit)