DF(1) | General Commands Manual | DF(1) |
df
— display free
disk space
df |
[--libxo ] [-b |
-g | -H |
-h | -k |
-m | -P ]
[-acIilntY ] [-, ]
[-T type]
[file | filesystem ...] |
df
[--libxo
]
[-b
| -g
|
-H
| -h
|
-k
| -m
|
-P
] [-acIilnY
]
[-,
] [-T
type] [-t
type] [file |
filesystem ...]
The df
utility displays statistics about
the amount of free disk space on the specified mounted file
system or on the file system of which file is a
part. By default block counts are displayed with an assumed block size of
512 bytes. If neither a file or a file system operand is specified,
statistics for all mounted file systems are displayed (subject to the
-t
option below).
The following options are available:
--libxo
-a
MNT_IGNORE
flag. This is implied for file systems
specified on the command line.-b
BLOCKSIZE
specification from the environment. This
is the same as the -P
option. The
-k
option overrides this option.-c
-g
BLOCKSIZE
specification from the
environment.-h
-H
,
--si
-h
but based on powers of 1000.-I
-i
below.-i
-h
or -H
options,
the number of inodes is scaled by powers of 1000. In case the filesystem
has no inodes then ‘-’ is displayed instead of the usage
percentage.
This option is now the default to conform to
Version 3 of the Single UNIX Specification
(“SUSv3”). Use -I
to
suppress this output.
-k
-P
option and any
BLOCKSIZE
specification from the environment.-l
-T
type option,
file system types will be added or excluded acccording to the parameters
of that option.-m
BLOCKSIZE
specification from the
environment.-n
df
will
not request new statistics from the file systems, but will respond with
the possibly stale statistics that were previously obtained.-P
BLOCKSIZE
specification from the environment. This
is the same as the -b
option. The
-g
and -k
options override
this option. In compatibility mode, this also suppresses inode
counts.-T
type-l
option, the parameters of this option will modify the list of
locally-mounted file systems selected by the -l
option. For example, the df
command:
df -T nonfs,mfs
lists all file systems except those of type NFS and MFS. The lsvfs(1) command can be used to find out the types of file systems that are available on the system.
-t
-T
, but this usage is deprecated and should not be
relied upon.-Y
-
,BLOCKSIZE
Show human readable free disk space for all mount points including file system type:
$ df -ahY Filesystem Type Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk1s5s1 apfs 465Gi 15Gi 266Gi 6% 533k 2.8G 0% / devfs devfs 194Ki 194Ki 0Bi 100% 672 0 100% /dev /dev/disk1s2 apfs 465Gi 3.4Gi 266Gi 2% 1.6k 2.8G 0% /System/Volumes/Preboot /dev/disk1s4 apfs 465Gi 3.0Gi 266Gi 2% 3 2.8G 0% /System/Volumes/VM /dev/disk1s6 apfs 465Gi 11Mi 266Gi 1% 33 2.8G 0% /System/Volumes/Update /dev/disk1s1 apfs 465Gi 177Gi 266Gi 40% 3.9M 2.8G 0% /System/Volumes/Data
The filesystems on this machine are virtual volumes on a single partition. Therefore, the size and space available is the same for all filesystems even though the space in use is different. The capacity column shows the amount of space used by each filesystem as a percentage of the sum of space used and space available.
Show previously collected data, excluding inode information,
except for the devfs file system. Note that the “no” prefix
affects all the file systems in the list and the -t
option can be specified only once:
$ df -l -I -n -t nodevfs Filesystem 1K-blocks Used Available Capacity Mounted on /dev/disk1s5s1 487196712 15300072 278432984 6% / /dev/disk1s2 487196712 3604640 278430312 2% /System/Volumes/Preboot /dev/disk1s4 487196712 3145748 278430312 2% /System/Volumes/VM /dev/disk1s6 487196712 11576 278430312 1% /System/Volumes/Update /dev/disk1s1 487196712 185371244 278432984 40% /System/Volumes/Data
Show human readable information for the file system containing the file /etc/rc.common:
$ df -h /etc/rc.common Filesystem Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk1s1 465Gi 177Gi 266Gi 40% 3.9M 2.8G 0% /System/Volumes/Data
Same as above but specifying some file system:
$ df -h /dev/disk1s1 Filesystem Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk1s1 465Gi 177Gi 266Gi 40% 3.9M 2.8G 0% /System/Volumes/Data
The "capacity" percentage is normally rounded up to the next higher integer. In legacy mode, it is rounded down to the next lower integer.
When the -P
option and the
-k
option are used together, sizes are reported in
1024-byte blocks.
The -t
option is normally a no-op (macOS
already prints the total allocated-space figures). In legacy mode, it is
equivalent to -T
.
For more information about legacy mode, see compat(5).
lsvfs(1), quota(1), fstatfs(2), getfsstat(2), statfs(2), getbsize(3), getmntinfo(3), libxo(3), localeconv(3), xo_parse_args(3), compat(5), fstab(5), mount(8), pstat(8), quot(8), swapinfo(8)
With the exception of most options, the df
utility conforms to IEEE Std 1003.1-2004
(“POSIX.1”), which defines only the
-k
, -P
and
-t
options.
A df
command appeared in
Version 1 AT&T UNIX.
The -n
flag is ignored if a file or file
system is specified. Also, if a mount point is not accessible by the user,
it is possible that the file system information could be stale.
The -b
and -P
options are identical. The former comes from the BSD tradition, and the
latter is required for IEEE Std 1003.1-2004
(“POSIX.1”) conformity.
February 22, 2023 | macOS 15.2 |