Show File System Disk Usage


df

The free command deals with the RAM you have on your system; likewise, the df command (think disk free) deals with the amount of hard drive space you have. Run df, and you get a list of the disk space that is available to, and used by, every mounted filesystem.

$ df Filesystem  1Kblocks    Used  Available Use% Mounted on /dev/hda1    7678736  5170204   2508532  68% / tmpfs         518068        0    518068   0% /dev/shm tmpfs         518068    12588    505480   3% /lib/modules/2.6.12-10-386/volatile /dev/hda2   30369948 24792784   5577164  82% /home 


Before looking at these results in a more detail, let's make them a little easier to read. The df command shows results in kilobytes by default, but it's usually easier to comprehend if you instead use the -h (or --human-readable) option.

$ df -h Filesystem Size Used  Avail Use% Mounted on /dev/hda1  7.4G 5.0G  2.4G  68% / tmpfs      506M    0  506M   0% /dev/shm tmpfs      506M  13M  494M   3% /lib/modules/2.6.12-10-386/volatile /dev/hda2   29G  24G  5.4G  82% /home 


"Human-readable" (which is a wonderful term, by the way) means that kilobytes are indicated by K, megabytes by M, and gigabytes by G. You can see those last two in the preceding listing.

So what do the results mean? You have two partitions on the hard drive: /dev/hda1, mounted at /, and /dev/hda2, mounted at /home. The /home partition had 29GB allocated to it, of which 82% is currently used, leaving about 5.4GB free. It's not panic time yet when it comes to disk space for that partition, but a few more CDs worth of MP3s and it might be time to delete some unnecessary files.

The root partition, or /, has less space available: only 2.4GB out of 7.4GB. That partition isn't as likely to grow, however, because it contains programs and other relatively static files. Granted, /var is found there, and that's where software installers (as you'll discover in Chapter 13, "Installing Software") and other files that change size and contents, such as logs, are located. But overall, there's still plenty of space left on that partition, especially if you're not planning to install enormous applications or start running a web or database server on this machine.

The other two partitions are both labeled as tmpfs, which means they are temporary file systems used by the virtual memory, or swap space, on your computer. When you shut down your computer, the contents of those partitions disappear.

Tip

For more on tmpfs, see the Wikipedia article at http://en.wikipedia.org/wiki/TMPFS.




Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net