6.12. File Systems and Their Usage: mount, df, and du

The command mount shows which file system (device and type) is mounted at which mount point:

tester@linux:~> mount
/dev/hda3 on / type reiserfs (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/hda1 on /boot type ext2 (rw,acl,user_xattr)
/dev/hda4 on /local type reiserfs (rw,acl,user_xattr)
/dev/fd0 on /media/floppy type subfs (rw,nosuid,nodev,noatime,fs=floppyfss,procuid)
  

Obtain information about total usage of the file systems with the command df. The parameter -h (or --human-readable) transforms the output into a form understandable for common users.

tester@linux:~> df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda3              11G  3.2G  6.9G  32% /
udev                  252M  104K  252M   1% /dev
/dev/hda1              16M  6.6M  7.8M  46% /boot
/dev/hda4              27G   34M   27G   1% /local
  

Display the total size of all the files in a given directory and its subdirectories with the command du. The parameter -s suppresses the output of detailed information. -h again transforms the data into a human-readable form:

tester@linux:~> du -sh /local
1.7M    /local