Displaying Blocks and Files Used
The df command and its given options can be used to report the number of free disk files and blocks.
Syntax:
df [option]
option:
-k - prints the free disk space in terms of k bytes. Let consider the subsequent example
# df
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/hda3 247871 212909 22161 91% /
/dev/hda6 50717 15507 32591 32% /var
/dev/hda7 481998 15 457087 0% /local
# df -k
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda7 396623 71930 304212 19% /
/dev/hda1 101089 2453 93417 3% /boot
/dev/hda6 1517920 12952 1427860 1% /home
/dev/hda5 1517920 1276308 164504 89% /usr
/dev/hda9 54416 18548 33059 36% /var
The columns reported displays:
Filesystem - It refers to the file system being displays. File systems mounted using NFS are displays as hostname:/dir/that/is/mounted
1024-blocks - The number of 1 KB blocks the file system consists of. (Its whole size)
Used - The number of blocks used.
Available - Display the number of blocks available for use.
Capacity - Percentage of partition presently used.
Mounted on - The location in the directory tree where this partition has been mounted on.
The du command summarizes disk usage through directory. It recurses by all subdirectories and displays disk usage through each subdirectory with a last total at the end.