[Previous] [Contents] [Next]

df

Report disk space free (POSIX)

Syntax:

Report disk space free:

    df [-abdhw] [-n node] [file...]

Report mapping points:

    df -m [-w] [-n node]

Options:

-a
(QNX extension) Display all block devices, with the exception of any for which no size information is available. Information will be displayed for a block device even if it's not mounted as a filesystem.
-b
(QNX extension) Display disk space in blocks of 512 bytes (default is units of 1K).
-d
(QNX extension) Show duplicate devices (i.e. multiple prefixes or mounts to the same device). If -d isn't specified, only the first mapping that resolves to a particular filesystem will be shown.
-h
(QNX extension) Display a header.
-m
(QNX extension) Instead of displaying free disk space, display a map of prefix mappings available under / on the specified node (or the node df is running on if -n isn't specified). This will show the name the directory appears as under /, and the actual directory it maps to (including its node prefix //n/). This option is very useful when debugging prefix problems in a network.
-n node
(QNX extension) Use the specified node's prefix tree to resolve the possible pathname(s) to mounted filesystems.
-w
(QNX extension) Warn about prefix mappings that hit or exceed five levels of nesting. This usually indicates that a namespace hasn't been "sensibly" configured.
file
The pathname of a file within the hierarchy of the desired filesystem.

Description:

The df utility provides disk space information as well as mappings of prefix namespace resolution under /. The utility has two invocation modes.

df [-abdhw] [-n node] [file...]
In this mode, df prints the amount of available space for filesystems to which the user has read access. Filesystems are specified by file operands. When no file operands are specified, df produces information for every filesystem available under / (i.e. nothing that requires a //n/ prefix).
df -m [-w] [-n node]
In this (map) mode, df prints prefix mapping points (directories) available under / and the actual filesystem point they resolve to. The mapping point is displayed as a full path, with a node prefix. You invoke this mode by specifying the -m option.

When displaying disk space information, df produces output that consists of one line of information for each specified filesystem. If -h is specified, the output contains a one-line header indicating the meaning of each column. The fields on the output lines are, in order:

filesystem name
The name of the filesystem (i.e. the name of the block special file, including node number).
total space
The total formatted capacity of the disk drive or partition in question.
total available user space
The total amount of space available to the user. This is the sum of space used + space free.
space used
The total amount of space allocated to all files within the filesystem.
space free
The total amount of space available within the filesystem for the creation of new files by unprivileged users. When this figure is less than or equal to zero, it's not possible to create any new files on the filesystem without first deleting others.
percentage used
The percentage of the normally available space that is currently allocated to files. This is the fraction: expressed as a percentage, rounded to the nearest integer. If total available user space is zero, then this percentage is displayed as "100%". This percentage may be greater than 100 if total space isn't equal to total available user space.
filesystem mount point
The directory below which the filesystem hierarchy appears.

If a file operand is specified, this column will show the actual mount point of the filesystem within which the file resides, including the node prefix.

If no file operand is specified, this column will show the path through which the listed filesystem is accessed. You should note that depending on prefix mappings, a pathname may not be a mount point but rather an alias prefix.

Note that entries will be skipped when information on the filesystem cannot be obtained, except when the -a option is used, in which case block special files and their sizes will be listed even if they are not mounted as filesystems.

Examples:

Print information about the filesystems accessible under /:

    df

Print information about the filesystem that /usr/src resides on:

    df /usr/src

Show information on prefix mappings accessible under /, with warnings about deep-nesting:

    df -mw

Files:

df writes its output to the standard output. If an error occurs, a diagnostic message will be written to the standard error. The standard input is not used.

Exit status:

0
Successful completion.
>0
An error occurred.

See also:

du, prefix


[Previous] [Contents] [Next]