Use du to show directory sizes only

By | 2013/01/11

du can show directory sizes only. This is helpful to get a quick glance at what directories are taking up space. Here’s the command I like to use:

$ du -hsc *

Here is what it looks like in action from /var on one of my servers:

user@li166-66:/var$ sudo du -hsc *
399M    backups
115M    cache
2.0G    lib
4.0K    local
0       lock
1.8G    log
4.0K    mail
4.0K    opt
0       run
2.3M    spool
4.0K    tmp
11G     www
16G     total