Use the df command and its options to report the number of free disk blocks and files. For more information, see df(1M).
Display information about how disk space is used by using the df command.
$ df [directory] [-F fstype] [-g] [-k] [-t] |
df |
With no options, lists all mounted file systems and their device names, the number of total 512-byte blocks used, and the number of files. |
directory |
Directory whose file system you want to check. The device name, blocks used, and number of files are displayed. |
-F fstype |
Displays a list of unmounted file systems, their device names, the number of 512-byte blocks used, and the number of files on file systems of type fstype. |
-g |
Displays the statvfs structure for all mounted file systems. |
-k |
Displays a list of file systems, kilobytes used, free kilobytes, percent capacity used, and mount points. |
-t |
Displays total blocks as well as blocks used for all mounted file systems. |
For remotely mounted file systems, "-1 files"is displayed instead of the number of files.
In the following example, the file systems root (/), /usr, /proc, and /tmp are on the local disk. The other file systems are mounted by NFS and do not use local disk resources.
$ df / (/dev/dsk/c0t3d0s0 ): 30374 blocks 14002 files /usr (/dev/dsk/c0t3d0s6 ): 40714 blocks 80522 files /proc (/proc ): 0 blocks 429 files /dev/fd (fd ): 0 blocks 0 files /export/home (/dev/dsk/c0t3d0s7 ): 10712 blocks 10564 files /export/root (/dev/dsk/c0t3d0s3 ): 69180 blocks 18812 files /export/swap (/dev/dsk/c0t3d0s4 ): 61804 blocks 29563 files /opt (/dev/dsk/c0t3d0s5 ): 15722 blocks 13147 files /tmp (swap ): 57104 blocks 5653 files /usr/local (mars:/usr/local ): 435040 blocks -1 files $ |
In the following example, the file system, total Kbytes, used Kbytes, available Kbytes, percent of capacity used, and mount point are displayed.
$ df -k Filesystem kbytes used avail capacity Mounted on /dev/dsk/c0t3d0s0 30991 15812 12089 57% / /dev/dsk/c0t3d0s6 185303 164946 1827 99% /usr /proc 0 0 0 0% /proc fd 0 0 0 0% /dev/fd /dev/dsk/c0t3d0s7 19095 13739 3456 80% /export/home /dev/dsk/c0t3d0s3 34599 9 31140 1% /export/root /dev/dsk/c0t3d0s4 55511 24609 25352 50% /export/swap /dev/dsk/c0t3d0s5 23063 15202 5561 74% /opt swap 29564 976 28588 4% /tmp mars:/usr/local 5353093 5135591 163972 97% /usr/local $ |
The following example shows information about the same system as the previous example, but only UFS file system information is displayed.
$ df -F ufs / (/dev/dsk/c0t3d0s0 ): 30358 blocks 14002 files /usr (/dev/dsk/c0t3d0s6 ): 40714 blocks 80522 files /export/home (/dev/dsk/c0t3d0s7 ): 10712 blocks 10564 files /export/root (/dev/dsk/c0t3d0s3 ): 69180 blocks 18812 files /export/swap (/dev/dsk/c0t3d0s4 ): 61804 blocks 29563 files /opt (/dev/dsk/c0t3d0s5 ): 15722 blocks 13147 files $ |
Although /proc and /tmp are local file systems, they are not UFS file systems (/proc is a PROCFS file system, and /tmp is a TMPFS file system).
The following example shows a list of all mounted file systems, device names, total 512-byte blocks used, and number of files. The second line of each two-line entry displays the total number of blocks and files allocated for the file system.
$ df -t / (/dev/dsk/c0t3d0s0 ): 30358 blocks 14002 files total: 61982 blocks 16128 files /usr (/dev/dsk/c0t3d0s6 ): 40714 blocks 80522 files total: 370606 blocks 94080 files /proc (/proc ): 0 blocks 429 files total: 0 blocks 492 files /dev/fd (fd ): 0 blocks 0 files total: 0 blocks 26 files /export/home (/dev/dsk/c0t3d0s7 ): 10712 blocks 10564 files total: 38190 blocks 10752 files /export/root (/dev/dsk/c0t3d0s3 ): 69180 blocks 18812 files total: 69198 blocks 18816 files /export/swap (/dev/dsk/c0t3d0s4 ): 61804 blocks 29563 files total: 111022 blocks 29568 files /opt (/dev/dsk/c0t3d0s5 ): 15722 blocks 13147 files total: 46126 blocks 13440 files /tmp (swap ): 57144 blocks 5653 files total: 59096 blocks 5768 files /usr/local (mars:/usr/local ): 435008 blocks -1 files total: 10706186 blocks -1 files $ |