Monday, June 13, 2011

Unix - Commands to find disk usage

df: (disk free)
Df –k <directory name>
e.g. df –k . or df –k /
du: (disk usage)
The disk usage (du) command shows the size of each file or directory in the current directory:
  y> du -sk * | sort -n
The "s" option returns a summary of a directory's contents (rather than a full listing), and the "k" option shows the output in 1 KB increments (rather than the default 512 byte increments). The sort command lists them in ascending size order, with the largest directory last.

This will show which directory is using your space, "home," "pub," or "mail." (Ignore the "backup" directory; that is for the nightly backup snapshot and does not impact your disk usage.)

  y> du -sk * | sort -n
  6234    mail
  6018    pub
  182819   home
  95045   backup
In this example, the home directory is where most of the space is being used: almost 183 MB.


  1. :: lemme be url bull dozern losten pi-wholed$::||

    1. && f00tours

    2. Multicast Protocols Feature Guide for the NFX250 Network Services ...
      Juniper Networks

  2. ::