Figuring Out Available Disk Space
Monday, February 4th, 2008Related to disk quota management is the simpler question of how much disk space is available on the system. The df command reports disk usage on a per-disk basis, but the output can be a bit baffling:
$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hdb2 25695892 1871048 22519564 8% /
/dev/hdb1 101089 6218 89652 7% /boot
none 127744 0 127744 0% /dev/shm
What would be much more useful is a version of df that summarizes the available capacity values in column four and then presents the summary in a way that is easily understood. It’s a task easily accomplished in a script.