You can use df to determine the number of free disk blocks and inodes which are still available at mounted or unmounted local systems and to obtain information on the file system coding (ASCII or EBCDIC).
Syntax
Format 1: |
df[ -F FSType] -P[ -lV][ -k | -h | -H][ file] |
Format 2: |
df[ -F FSType][ -beglntVv][ -k | -h | -H][ -o ufs_options]...[ file] |
Format 3: |
df -c[ file]... |
The file system with which you want to work is of the type FSType. You only need to specify this option if the file system is unmounted. FSType may be:
Prints the following information in columns for all mounted file systems or for the specified file systems:
df prints the number of free blocks and inodes for all locally mounted file systems or for the specified file systems. The -l option is set by default. It cannot be combined with -e or -o.
df expands the df command line and writes the completed command to standard output, but does not execute the command. df completes the command line, adding information derived from /etc/mnttab and /etc/vfstab to input provided by the user. The added information relates to the option -F FSType and/or the associated special file, depending on which of the two components, if either, was specified on the command line. If you enter df -V without other options and arguments, you will be shown a list of df command lines indicating all mounted file system types and the associated special file names.
Prints the following information in columns for all mounted file systems or for the specified file systems (like option -P). Storage space is listed in 1024-byte blocks (instead of 512-byte blocks). The storage space specification takes account of the reserved storage space which can only be used by the POSIX administrator.
This option is equivalent to the -k option except that the sizes are not printed in 1024-byte blocks but in KB (210 bytes), MB (220 bytes), GB (230 bytes) or TB (240 bytes).
This option is equivalent to the -k option except that the sizes are not printed in 1024-byte blocks but in KB (103 Bytes), MB (106 Bytes), GB (109 Bytes) or TB (212 Bytes).
file is either the name of a directory or the name of a special file which contains a file system. If you name a directory, df examines the file system mounted on that directory. You may name more than one file. file not specified:
No option specified df prints the number of free blocks and inodes in all mounted or all specified file systems.
The file system with which you want to work is of the type FSType. You only need to specify this option if the file system is unmounted. FSType may be:
Prints the free disk space (in Kbytes). This option cannot be combined with -o.
Prints the number of free inodes. This option cannot be combined with -o, and it overrides the -l option.
Prints the entire statvfs structure for all mounted file systems or for FSType or file. The output consists of 4 lines containing the following information:
This option cannot be combined with -o, and it overrides options -b, -e, -k, -l, -n, -r and -v.
Prints the following information in columns for all mounted file systems or for the specified file systems:
The storage space specification takes account of the reserved storage space which can only be used by the POSIX administrator. This option cannot be combined with -o, and it overrides options -b, -e, -k, -l, -n, -r and -v.
df prints the number of free blocks and inodes for all locally mounted file systems or for the specified file systems. The -l option is set by default. It cannot be combined with -e or -o.
df outputs the file system type. If you combine -n with -o or -f then an error message is displayed.
df prints the number of free blocks and files as well as the total number of available blocks and files for each mounted or specified file system. -t overrides the -b option. Combining -t with -o i produces a totals line for all the columns in the -o i output.
df expands the df command line and writes the completed command to standard output, but does not execute the command. df completes the command line, adding information derived from /etc/mnttab and /etc/vfstab to input provided by the user. The added information relates to the option -F If you enter df
df prints the following information in columns for all mounted file systems or for the specified file systems:
This option cannot be combined with -o, and it overrides options -b, -e, -k, -l, -n, -r and -v.
If the file system type is ufs, you can use a ufs-specific option: df prints the following information in columns:
The only options with which -o
file is either the name of a directory or the name of a special file associated with a file system. If you name a directory, df examines the file system mounted on that directory. You may name more than one file. file not specified:
The command outputs the type of coding (ASCII or EBCDIC) for all locally mounted file systems or those specified with file. This option cannot be combined with other options. |
Hint
In UFS file systems the available disk space is as a rule less than the free disk space. The reason for this is that some of the disk space (10%) is reserved for privileged applications and is consequently not available for normal applications. |
Error
Some of the following error messages also indicate the correct syntax, but use some syntax elements that differ from the ones in the above description. The table below shows which syntax elements are equivalent:
An invalid or incomplete special file or directory name was specified with df
An invalid ufs_option argument was specified with the -o option. ufs_option can only be i.
An invalid file system type (xxx) was specified for FSType in the command df |
File
/dev/dsk/* Special files associated with the file systems /etc/mnttab Table of mounted file systems /etc/vfstab List of default parameters for each file system /etc/fs/FStyp/* Commands for specific file system types |
Locale
The following environment variables affect the execution of df: LANG Provide a default value for the internationalization variables that are unset or null. If LANG is unset of null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined. LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. |
Example 1
Printing the associated file system types for all user directories:
|
Example 2
Printing the entire statvfs structure for the file system /stand:
|
Example 3
The file system coding is to be output for the /home and /var directories:
|
See also
du |