Debianhelp.co.uk


Disk Space Usage Using Dispus in Linux and Unix Systems

What is Dispus ?

A PERL script for browsing directories and figuring out where space is being used on a *NIX systems. It is aware of mount points and will not include other file systems in the listings.

Supported Platforms

It has been tested on Sun Solaris 2.5.1 - 10, SCO OpenServer, SCO UnixWare, Linux, MacOS X, Cygwin, AIX and FreeBSD 5.5 Stable.

Download Dispus

http://anni.galaxy4.net/?page_id=3

http://anni.galaxy4.net/files/dispus26.zip

Install Dispus in Debian Linux

Download dispus from the above link once you downloaded the dispus26.zip file(/usr/bin) you need to extract this file using unzip

#unzip dispus26.zip

Now you have dispus perl script.If you want to use dispus you need to run against some directories or mount points.The below example display the details of root partition (/)

# ./dispus /
dispus v2.6 - Reading usage in /
Ignoring mount points: proc boot

  1,435,984 KB used of 34,850,976 KB available (5%)

  1.    722,592 KB   var
  2.    625,636 KB   usr
  3.     35,192 KB   lib
  4.      7,400 KB   etc
  5.      3,536 KB   sbin
  6.      3,244 KB   bin
  7.      1,836 KB   package
  8.      1,204 KB   home
  9.        804 KB   root
 10.        308 KB   tmp
 11.         96 KB   dev
 12.         48 KB   lost+found
 13.         12 KB   media
 14.          4 KB   sys
 15.          4 KB   srv
 16.          4 KB   service
 17.          4 KB   scripts
 18.          4 KB   opt
 19.          4 KB   mnt
 20.          4 KB   initrd
 21.          4 KB   command
              0 KB   vmlinuz
              0 KB   initrd.img
 24.          0 KB   cdrom

 1 to 24 of 24 shown   ? - help   q - quit

dispus>

Now if you want to see the file sizes inside each folder you can just select the directory number against each folder for example if i want to check size inside var folder you need to just enter the following command

dispus> 1

dispus v2.6 - Reading usage in /var

  1,436,156 KB used of 34,850,976 KB available (5%)

  1.    262,412 KB   tmp
  2.    167,288 KB   cache
  3.     98,288 KB   lib
  4.     87,016 KB   www
  5.     53,352 KB   log
  6.     52,160 KB   mail
  7.      1,124 KB   backups
  8.        944 KB   spool
  9.        148 KB   run
 10.         12 KB   lock
 11.          8 KB   state
 12.          4 KB   opt
 13.          4 KB   local

 1 to 13 of 13 shown   ? - help   q - quit

Type "?" at the "dispus>" prompt for a brief summary of the available commands

?       Display this help
0-9+    Traverse selected directory
.       Redisplay current directory
..      Traverse parent directory
c [dir] Change to specific directory
f       Page forward
b       Page back
q       Quit
s       Start $SHELL in current directory
k       Start /bin/ksh in current directory
![cmd]  Run command 'cmd' (or shell if omitted) in current directory

Explaining the Mount Points Detection

The detection of mount points can be done by constructing a list of mount points currently in use from the mount -v command, plus the list of mounts potentially mounted by the automounter from /etc/auto*master. This feature is a great boon, especially when browsing the root filesystem, where it can be very difficult to see what space in the du -s * output is on the current filesystem.