yossman.net - "df" unix command help (free space on drive)
document first created 1996-06-19.
document last updated 2004-01-23.

the "df" command in unix tells you how much free space is left on each "partition" on the hard drive(s). each partition represents a different type of space, for different usage. the "/" partition, usually called the "root" partition, is where most of the really important utilities are kept, including the main operating system's "kernel", the thing that drives unix. normal users are usually not permitted to write any files to the "/" partition.

the main partition you would be interested in is the "/usr" partition. this is where your "home directory" is located. if you were to log into yossman.net with the username "fred" then the path to your home directory would be "/usr/home/fred".

let's take a look at what "df" does. type "df" on your shell prompt, what you will see looks something like this:

Filesystem  1K-blocks     Used    Avail Capacity  Mounted on

/dev/wd0a       31775    16943    12290    58%    /
/dev/wd0s1f    233710   108516    90136    55%    /usr
/dev/wd0s1e     31775    16154    13079    55%    /var
procfs              4        4        0   100%    /proc
/dev/wd1b       48990       10    41630     0%    /tmp

first, the "Filesystem" column tells you what physical partition on the disk each row across the table is referring to. the "1K-blocks" tells you how many total kilobytes each partition has. the "Used" column tells you how many KB has been used on each partition, and the "Avail" part tells you how much space is left on the partition. "Capacity" is a percentage report which basically means "how full is this drive as a percent of its total capacity". Finally, the "Mounted on" column details which directory tree this partition is used for.

in unix, separate partitions are given certain jobs, so that if one gets too full or crashes the entire operating system doesn't crash. so when "/usr" gets too full because a user has downloaded some huge file, the rest of the system complains that /usr is now full, but continues to operate because the other partitions necessary to operate the system aren't full.

so in this example, let's take a look at the /usr partition, since that is the partition that mosts interests you as a user. if you want to check to see how much space is left on the /usr partition, where you files will be downloaded to, you should pay attention to this line from "df".

Filesystem  1K-blocks     Used    Avail Capacity  Mounted on

/dev/wd0s1f    233710   108516    90136    55%    /usr

we can safely ignore the first part, it doesn't mean anything for users anyway. The second column, the "1K-Blocks" number, tells us that there is 233710KB total disk space on that partition (about 228MB). The second number ("Used") tells us that 108516KB of it has been used (about 106MB) which leads us to the third number ("Avail") which says that this partition has about 88MB free (90136KB).

i strongly encourage any user, even those with quotas, to check to see that there is sufficient disk space before they go downloading something rather large. if i don't have the room ask me if there is anything i can do to accomodate your download.