System Administration Commands df(1M) NAME df - displays number of free disk blocks and files SYNOPSIS /usr/bin/df [-F _F_S_T_y_p_e] [-abeghklntVv] [-o _F_S_T_y_p_e- _s_p_e_c_i_f_i_c__o_p_t_i_o_n_s] [_b_l_o_c_k__d_e_v_i_c_e | _d_i_r_e_c_t_o_r_y | _f_i_l_e | _r_e_s_o_u_r_c_e ...] /usr/xpg4/bin/df [-F _F_S_T_y_p_e] [-abeghklnPtV] [-o _F_S_T_y_p_e- _s_p_e_c_i_f_i_c__o_p_t_i_o_n_s] [_b_l_o_c_k__d_e_v_i_c_e | _d_i_r_e_c_t_o_r_y | _f_i_l_e | _r_e_s_o_u_r_c_e ...] DESCRIPTION The df utility displays the amount of disk space occupied by mounted or unmounted file systems, the amount of used and available space, and how much of the file system's total capacity has been used. The file system is specified by dev- ice, or by referring to a file or directory on the specified file system. Used without operands or options, df reports on all mounted file systems. df may not be supported for all _F_S_T_y_p_e_s. If df is run on a networked mount point that the automounter has not yet mounted, the file system size will be reported as zero. As soon as the automounter mounts the file system, the sizes will be reported correctly. OPTIONS The following options are supported for both /usr/bin/df and /usr/xpg4/bin/df: -a Reports on all file systems including ones whose entries in /etc/mnttab (see mnttab(4)) have the ignore option set. -b Prints the total number of kilobytes free. -e Prints only the number of files free. -F _F_S_T_y_p_e Specifies the _F_S_T_y_p_e on which to operate. The -F option is intended for use with unmounted file sys- tems. The _F_S_T_y_p_e should be specified here or be deter- minable from /etc/vfstab (see vfstab(4)) by matching the _d_i_r_e_c_t_o_r_y, _b_l_o_c_k__d_e_v_i_c_e, or _r_e_s_o_u_r_c_e with an entry in the table, or by consulting /etc/default/fs. See default_fs(4). -g Prints the entire statvfs(2) structure. This option is SunOS 5.9 Last change: 5 Jun 2002 1 System Administration Commands df(1M) used only for mounted file systems. It can not be used with the -o option. This option overrides the -b, -e, -k, -n, -P, and -t options. -h Like -k, except that sizes are in a more human read- able format. The output consists of one line of infor- mation for each specified file system. This informa- tion includes the file system name, the total space allocated in the file system, the amount of space allocated to existing files, the total amount of space available for the creation of new files by unprivileged users, and the percentage of normally available space that is currently allocated to all files on the file system. All sizes are scaled to a human readable format, for example, 14K, 234M, 2.7G, or 3.0T. Scaling is done by repetitively dividing by 1024. This option overrides the -b, -e, -g, -k, -n, -t, and -V options. This option only works on mounted filesys- tems and can not be used together with -o option. -k Prints the allocation in kbytes. The output consists of one line of information for each specified file system. This information includes the file system name, the total space allocated in the file system, the amount of space allocated to existing files, the total amount of space available for the creation of new files by unprivileged users, and the percentage of normally available space that is currently allocated to all files on the file system. This option overrides the -b, -e, -n, and -t options. -l Reports on local file systems only. This option is used only for mounted file systems. It can not be used with the -o option. -n Prints only the _F_S_T_y_p_e name. Invoked with no operands, this option prints a list of mounted file system types. This option is used only for mounted file sys- tems. It can not be used with the -o option. -o _F_S_T_y_p_e-_s_p_e_c_i_f_i_c__o_p_t_i_o_n_s Specifies _F_S_T_y_p_e-_s_p_e_c_i_f_i_c options. These options are comma-separated, with no intervening spaces. See the manual page for the _F_S_T_y_p_e-_s_p_e_c_i_f_i_c command for details. -t Prints full listings with totals. This option over- rides the -b, -e, and -n options. -V Echoes the complete set of file system specific SunOS 5.9 Last change: 5 Jun 2002 2 System Administration Commands df(1M) command lines, but does not execute them. The command line is generated by using the options and operands provided by the user and adding to them information derived from /etc/mnttab, /etc/vfstab, or /etc/default/fs. This option may be used to verify and validate the command line. /usr/bin/df The following option is supported for /usr/bin/df only: -v Like -k, except that sizes are displayed in multiples of the smallest block size supported by each specified file system. The output consists of one line of information for each file system. This one line of information includes the following: +o the file system's mount point +o the file system's name +o the total number of blocks allocated to the file system +o the number of blocks allocated to existing files +o the number of blocks available for the creation of new files by unprivileged users +o the percentage of blocks in use by files /usr/xpg4/bin/df The following option is supported for /usr/xpg4/bin/df only: -P Same as -k except in 512-byte units. OPERANDS The df utility interprets operands according to the follow- ing precedence: _b_l_o_c_k__d_e_v_i_c_e, _d_i_r_e_c_t_o_r_y, _f_i_l_e. The following operands are supported: _b_l_o_c_k__d_e_v_i_c_e Represents a block special device (for example, /dev/dsk/c1d0s7); the corresponding file system need not be mounted. _d_i_r_e_c_t_o_r_y Represents a valid directory name. df reports on the file system that contains _d_i_r_e_c_t_o_r_y. SunOS 5.9 Last change: 5 Jun 2002 3 System Administration Commands df(1M) _f_i_l_e Represents a valid file name. df reports on the file system that contains _f_i_l_e. _r_e_s_o_u_r_c_e Represents an NFS resource name. USAGE See largefile(5) for the description of the behavior of df when encountering files greater than or equal to 2 Gbyte ( 2 **31 bytes). When a UFS file system is mounted with logging enabled, file system transactions that free blocks from files might not actually add those freed blocks to the file system's free list until some unspecified time in the future. This behavior improves file system performance but does not con- form to the POSIX, Single UNIX Specification, SPARC Confor- mance Definition, System V Application Binary Interface, System V Interface Definition, and X/Open Portability Guide Standards, which require that freed space be available immediately. To enable standards conformance regarding file deletions or to address the problem of not being able to grow files on a relatively full UFS file system even after files have been deleted, disable UFS logging (see mount_ufs(1M). EXAMPLES Example 1: Writing Portable Information About the /usr File System The following example writes portable information about the /usr file system: example% /usr/xpg4/bin/df -P /usr Example 2: Writing Portable Information About the /usr/src file System Assuming that /usr/src is part of the /usr file system, the following example writes portable information : example% /usr/xpg4/bin/df -P /usr/src Example 3: Using df to Display Inode Usage The following example displays inode usage on all ufs file systems: example% /usr/bin/df -F ufs -o i ENVIRONMENT VARIABLES SYSV3 This variable is used to override the default behavior SunOS 5.9 Last change: 5 Jun 2002 4 System Administration Commands df(1M) of df and provide compatibility with INTERACTIVE UNIX System and SCO UNIX installation scripts. As the SYSV3 variable is provided for compatibility purposes only, it should not be used in new scripts. When set, any header which normally displays "files" will now display "nodes". See environ(5) for descriptions of the following environment variables that affect the execution of df: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. EXIT STATUS The following exit values are returned: 0 Successful completion. >0 An error occurred. FILES /dev/dsk/* Disk devices /etc/default/fs Default local file system type. Default values can be set for the following flags in /etc/default/fs. For example: LOCAL=ufs, where LOCAL is the default parti- tion for a command if no FSType is specified. /etc/mnttab Mount table /etc/vfstab List of default parameters for each file system ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: /usr/bin/df ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |______________________________|______________________________| | Availability | SUNWcsu | |______________________________|______________________________| /usr/xpg4/bin/df SunOS 5.9 Last change: 5 Jun 2002 5 System Administration Commands df(1M) ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |______________________________|______________________________| | Availability | SUNWxcu4 | |______________________________|______________________________| | Interface Stability | Standard | |______________________________|______________________________| SEE ALSO find(1), df_ufs(1M), mount(1M), mount_ufs(1M), statvfs(2), default_fs(4), mnttab(4), vfstab(4), attributes(5), environ(5), largefile(5), standards(5) NOTES If UFS logging is enabled on a file system, the disk space used for the log is reflected in the df report. The log is allocated from free blocks on the file system, and it is sized approximately 1 Mbyte per 1 Gbyte of file system, up to a maximum of 64 Mbytes. SunOS 5.9 Last change: 5 Jun 2002 6