Summary of disk usage using du

Using the -s option on the disk usage command du gives a summary of the disk usage by the directories below.

du * -h -s

Run this on the / directory might give something like:

--@--#du / -h -s
 
   6.4M    bin
   6.0M    boot
   68K     dev
   4.9M    etc
   6.2G    home
   75M     lib
   du: `media/cdrom': No such file or directory
   du: `media/floppy': No medium found
   0       media
   94G     mnt
   29M     opt
   65M     proc
   76K     root
   12M     sbin
   1.7M    srv
   0       sys
   0       tmp
   1.6G    usr
   136M    var

Using an additional -x option means du will not read from mounted file systems. Handy to avoid the /mnt directory.

Back to GNU/Linux Command Line Tips