DF(1)

DF(1) | General Commands Manual | DF(1)

# NAME

`df` — display free disk space

# SYNOPSIS

`df` | [`-aclMnqW`] [`-G` | `-bkP` | `-bfgHhikmN`] [`-t` type] [file | file_system]...

# DESCRIPTION

`df` displays statistics about the amount of free disk space on the specified file_system or on the file system of which file is a part. By default, all sizes are reported in 512-byte block counts. If neither a file or a file_system operand is specified, statistics for all mounted, and not hidden (i.e.: not mounted with `MNT_IGNORE`), file systems are displayed (subject to the `-a`, `-l` and `-t` options below).

Note that the printed count of available blocks takes minfree into account, and thus will be negative when the number of free blocks on the file system is less than minfree.

The following options are available:

`-a`
  If no file, or file_system arguments are given, show all mount points, including those that were mounted with the `MNT_IGNORE` flag. Note that for file systems specified on the command line, that mount option is never considered.
`-b`
  Show space as units of basic blocks (512 bytes). This is normally the default; this option can be used to override a conflicting setting in the environment variable `BLOCKSIZE`.
`-c`
  Display a grand total for all shown mount points. When combined with `-f` only the total for the mount points which otherwise would be included is shown, not the individual entries.
`-f`
  Display only the available free space (or with `-i`, free inodes) in a minimal format. When there is to be only one line of output, only the value is shown, otherwise the value and the mount point, separated by a single space, are printed. For free space, the `-b`, `-g`, `-H`, `-h`, `-k` and `-m` options, and `BLOCKSIZE` are all used as normal. This option implies `-N` and is incompatible with `-P` and `-G`.
`-G`
  Display all the fields of the structure(s) returned by statvfs(2). This option cannot be used with the `-f`, `-i` or `-P` options, and is modelled after the Solaris `-g` option. This option will override the `-b`, `-g`, `-H`, `-h`, `-k` and `-m` options, as well as any setting of `BLOCKSIZE`.
`-g`
  The `-g` option causes size numbers to be reported in gigabytes (1024*1024*1024 bytes).
`-h`
  Use “human-readable” output for space data. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte, Exabyte in order to reduce the number of digits to four or less.
`-H`
  As with `-h` but using powers of 10 (1000) rather than 2 (1024).
`-i`
  Include statistics on the number of free inodes. When combined with `-f` only the number of free inodes is shown.
`-k`
  By default, all sizes are reported in 512-byte block counts, unless the `BLOCKSIZE` environment variable is set. The `-k` option causes the size numbers to be reported in kilobytes (1024 bytes).
`-l`
  Display statistics only about mounted file systems with the `MNT_LOCAL` flag set. If a non-local file system is given as an argument, a warning is issued and no information is given on that file system.
`-M`
  Each file (or file_system) specified as an argument must give a path to a mount point in the tree, at which a file system is currently mounted. Information for that mounted file system is, if not otherwise excluded, provided. If a file which does not name a mount point is specified, a warning is issued, and no information is given for the file system on which that file resides (unless some other file names its mount point).
`-m`
  The `-m` option causes size numbers to be reported in megabytes (1024*1024 bytes).
`-N`
  Suppress the header line normally output. This option is ignored with `-G` which has no header line to ignore, and with `-P` which requires the header line to maintain the portable format it is designed to emulate.
`-n`
  Print out the previously obtained statistics from the file systems. This option should be used if it is possible that one or more file systems are in a state such that they will not be able to provide statistics without a long delay. When this option is specified, `df` will not request new statistics from the file systems, but will respond with the possibly stale statistics that were previously obtained.
`-P`
  Produce output in the following portable format:

  The output will be preceded by the following header line:

      "Filesystem <blksize>-blocks Used Available Capacity Mounted on\n"

  The header line is followed by data formatted as follows:

      "%s %d %d %d %d%% %s\n", <file system name>, <total space>,
          <space used>, <space free>, <percentage used>,
          <file system root>

  Note that the `-i` option may not be specified with `-P`, and the blksize is required to be 512 or 1024.

`-q`
  Suppress all warning output.
`-t` type
  Is used to indicate the actions should only be taken on file systems of the specified type. More than one type may be specified in a comma-separated list. The list of file system types can be prefixed with “no” to specify the file system types for which action should not be taken. If a file system is given on the command line that is not of the specified type, a warning is issued and no information is given on that file system.
`-W`
  Print the wedge name instead of the mounted from device for wedges. The wedge name is prefixed with “NAME=” as in fstab(5). If the wedge information cannot be obtained for one or more file systems, the `-W` option is silently ignored for those file systems.

If more than one of `-b`, `-g`, `-H`, `-h`, `-k` or `-m` is given, the last of those specified is used.

# ENVIRONMENT

`BLOCKSIZE`
  If the environment variable `BLOCKSIZE` is set, and none of the `-b`, `-g`, `-H`, `-h`, `-k` and `-m` options are specified, the block counts will be displayed in units of that size block.

# SEE ALSO

quota(1), fstatvfs(2), getvfsstat(2), statvfs(2), getbsize(3), getmntinfo(3), humanize_number(3), fs(5), fstab(5), mount(8), quot(8), tunefs(8)

# HISTORY

A `df` utility appeared in Version 1 AT&T UNIX. The `-f` option was added in NetBSD 10.

August 3, 2024 | NetBSD 11.0