Viewing File Systems with df
If you're used to Windows or Macintosh (prior to OS X) operating systems, you're probably accustomed to having separate hard drives (C:, D:, E: for Windows users, or real names for Macs), which are just different storage spaces. In Unix systems, different storage spaces are grafted onto the overall tree structure tacked onto what already exists without any clear distinction indicating where actual disk drives are located. For example, if you have a folder on a Windows computer, you know that all of the subfolders and files within it are located on the same hard drive. In Unix, everything resides within the root directory, but any different directory could be located on a different physical hard drive. You might think of it as tacking a new branch onto your artificial Christmas tree.
These tacked-on storage spaces are called file systems. Particularly if you're running a Unix system (as opposed to just using one), you might need to find out what file systems are in use (or mounted in the system, in technical terms), how much space they have, and where they attach to the Unix system (or where their mountpoints are). You can find out this information using df, as shown in Code Listings 7.3 and 7.4.
Code Listing 7.3. This small Linux system has relatively simple file systems.
To find out about file systems with df:
Code Listing 7.4. This large ISP's file systems are considerably more complex.
Code Listings 7.3 and 7.4 show the output of df on two different systems.
If you're a system administrator, you can use this information to help diagnose problems occurring in the system. If you're an average user (of above-average curiosity), you can use this information to satisfy your inquisitive inclinations or to tip off a system administrator to problems. For example, if you're getting odd errors or unpredictable results with a specific program, using df might reveal that the /home file system is full or maybe that you don't have the /dev/cdrom file system that you thought was installed and mounted. Hmmm!