Linux disk usage statistics

The following are some useful commands to figure out which directory is consuming all of your disk space.

You can use the df command to find your disk free space for your mounted filesystems, for example :-

Show Plain Text
Text code
  1. # df -h -T
  2. Filesystem    Type    Size  Used Avail Use% Mounted on
  3. /dev/sda1     ext3     57G   15G   39G  28% /
  4. tmpfs        tmpfs    1.9G     0  1.9G   0% /lib/init/rw
  5. udev         tmpfs     10M   52K   10M   1% /dev
  6. tmpfs        tmpfs    1.9G     0  1.9G   0% /dev/shm
  7.  

The du cammand can be used to give your disk usage information, for example :-

Show Plain Text
Text code
  1. # ls | du -ch
  2. 52K     ./mysql
  3. 4.0K    ./bittorrent
  4. 20K     ./apt
  5. 136K    ./ntpstats
  6. 4.0K    ./samba/cores/smbd
  7. 4.0K    ./samba/cores/nmbd
  8. 12K     ./samba/cores
  9. 4.9M    ./samba
  10. 4.0K    ./iptraf
  11. 540K    ./apache2
  12. 12K     ./fsck
  13. 56K     ./exim4
  14. 4.0K    ./news
  15. 9.2M    ./installer/cdebconf
  16. 9.8M    ./installer
  17. 21M     .
  18. 21M     total
Filed under: Linux  Tags: Debian, Ubuntu

1 Responses to “Linux disk usage statistics”

It is usefull du -k |sort -nr

Sorry, comments have been closed for this post.