.\" .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for .\" permission to reproduce portions of its copyrighted documentation. .\" Original documentation from The Open Group can be obtained online at .\" http://www.opengroup.org/bookstore/. .\" .\" The Institute of Electrical and Electronics Engineers and The Open .\" Group, have given us permission to reprint portions of their .\" documentation. .\" .\" In the following statement, the phrase ``this text'' refers to portions .\" of the system documentation. .\" .\" Portions of this text are reprinted and reproduced in electronic form .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition, .\" Standard for Information Technology -- Portable Operating System .\" Interface (POSIX), The Open Group Base Specifications Issue 6, .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics .\" Engineers, Inc and The Open Group. In the event of any discrepancy .\" between these versions and the original IEEE and The Open Group .\" Standard, the original IEEE and The Open Group Standard is the referee .\" document. The original Standard can be obtained online at .\" http://www.opengroup.org/unix/online.html. .\" .\" This notice shall appear on any product containing this material. .\" .\" The contents of this file are subject to the terms of the .\" Common Development and Distribution License (the "License"). .\" You may not use this file except in compliance with the License. .\" .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE .\" or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions .\" and limitations under the License. .\" .\" When distributing Covered Code, include this CDDL HEADER in each .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. .\" If applicable, add the following below this CDDL HEADER, with the .\" fields enclosed by brackets "[]" replaced with your own identifying .\" information: Portions Copyright [yyyy] [name of copyright owner] .\" .\" .\" Copyright 1989 AT&T .\" Portions Copyright (c) 1992, X/Open Company Limited All. Rights Reserved. .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved. .\" .TH DF 8 "Apr 14, 2016" .SH NAME df \- displays number of free disk blocks and free files .SH SYNOPSIS .LP .nf \fB/usr/bin/df\fR [\fB-F\fR \fIFSType\fR] [\fB-abeghklmnPtVvZ\fR] [\fB-o\fR \fIFSType-specific_options\fR] [\fIblock_device\fR | \fIdirectory\fR | \fIfile\fR | \fIresource\fR ...] .fi .SH DESCRIPTION .LP The \fBdf\fR 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 device, or by referring to a file or directory on the specified file system. .sp .LP Used without operands or options, \fBdf\fR reports on all mounted file systems. .sp .LP \fBdf\fR may not be supported for all \fIFSTypes\fR. .sp .LP If \fBdf\fR 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. .SH OPTIONS .ne 2 .na \fB\fB-a\fR\fR .ad .sp .6 .RS 4n Reports on all file systems including ones whose entries in \fB/etc/mnttab\fR (see \fBmnttab\fR(5)) have the \fBignore\fR option set. .RE .sp .ne 2 .na \fB\fB-b\fR\fR .ad .sp .6 .RS 4n Prints the total number of kilobytes free. .RE .sp .ne 2 .na \fB\fB-e\fR\fR .ad .sp .6 .RS 4n Prints only the number of files free. .RE .sp .ne 2 .na \fB\fB-F\fR \fIFSType\fR\fR .ad .sp .6 .RS 4n Specifies the \fIFSType\fR on which to operate. The \fB-F\fR option is intended for use with unmounted file systems. The \fIFSType\fR should be specified here or be determinable from \fB/etc/vfstab\fR (see \fBvfstab\fR(5)) by matching the \fIdirectory\fR, \fIblock_device\fR, or \fIresource\fR with an entry in the table, or by consulting \fB/etc/default/fs\fR. See \fBdefault_fs\fR(5). .RE .sp .ne 2 .na \fB\fB-g\fR\fR .ad .sp .6 .RS 4n Prints the entire \fBstatvfs\fR(2) structure. This option is used only for mounted file systems. It can not be used with the \fB-o\fR option. This option overrides the \fB-b\fR, \fB-e\fR, \fB-k\fR, \fB-n\fR, \fB-P\fR, and \fB-t\fR options. .RE .sp .ne 2 .na \fB\fB-h\fR\fR .ad .sp .6 .RS 4n Like \fB-k\fR, except that sizes are in a more human readable format. 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. All sizes are scaled to a human readable format, for example, \fB14K\fR, \fB234M\fR, \fB2.7G\fR, or \fB3.0T\fR. Scaling is done by repetitively dividing by \fB1024\fR. .sp This option overrides the \fB-b\fR, \fB-e\fR, \fB-g\fR, \fB-k\fR, \fB-n\fR, \fB-t\fR, and \fB-V\fR options. This option only works on mounted filesystems and can not be used together with \fB-o\fR option. .RE .sp .ne 2 .na \fB\fB-k\fR\fR .ad .sp .6 .RS 4n 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 \fB-b\fR, \fB-e\fR, \fB-n\fR, and \fB-t\fR options. .RE .sp .ne 2 .na \fB\fB-l\fR\fR .ad .sp .6 .RS 4n Reports on local file systems only. This option is used only for mounted file systems. It can not be used with the \fB-o\fR option. .RE .sp .ne 2 .na \fB\fB-m\fR\fR .ad .sp .6 .RS 4n Like -k, except prints the allocation in mbytes. .RE .sp .ne 2 .na \fB\fB-n\fR\fR .ad .sp .6 .RS 4n Prints only the \fIFSType\fR name. Invoked with no operands, this option prints a list of mounted file system types. This option is used only for mounted file systems. It can not be used with the \fB-o\fR option. .RE .sp .ne 2 .na \fB\fB-o\fR \fIFSType-specific_options\fR\fR .ad .sp .6 .RS 4n Specifies \fIFSType-specific\fR options. These options are comma-separated, with no intervening spaces. See the manual page for the \fIFSType-specific\fR command for details. .RE .sp .ne 2 .na \fB\fB-t\fR\fR .ad .sp .6 .RS 4n Prints full listings with totals. This option overrides the \fB-b\fR, \fB-e\fR, and \fB-n\fR options. .RE .sp .ne 2 .na \fB\fB-V\fR\fR .ad .sp .6 .RS 4n Echoes the complete set of file system specific 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 \fB/etc/mnttab\fR, \fB/etc/vfstab\fR, or \fB/etc/default/fs\fR. This option may be used to verify and validate the command line. .RE .sp .ne 2 .na \fB\fB-Z\fR\fR .ad .sp .6 .RS 4n Displays mounts in all visible zones. By default, \fBdf\fR only displays mounts located within the current zone. This option has no effect in a non-global zone. .RE .sp .ne 2 .na \fB\fB-v\fR\fR .ad .sp .6 .RS 4n Like \fB-k\fR, except that sizes are displayed in multiples of the smallest block size supported by each specified file system. .sp The output consists of one line of information for each file system. This one line of information includes the following: .RS +4 .TP .ie t \(bu .el o the file system's mount point .RE .RS +4 .TP .ie t \(bu .el o the file system's name .RE .RS +4 .TP .ie t \(bu .el o the total number of blocks allocated to the file system .RE .RS +4 .TP .ie t \(bu .el o the number of blocks allocated to existing files .RE .RS +4 .TP .ie t \(bu .el o the number of blocks available for the creation of new files by unprivileged users .RE .RS +4 .TP .ie t \(bu .el o the percentage of blocks in use by files .RE .RE .sp .ne 2 .na \fB\fB-P\fR\fR .ad .sp .6 .RS 4n Same as \fB-h\fR except in 512-byte units. .RE .SH OPERANDS .LP The \fBdf\fR utility interprets operands according to the following precedence: \fIblock_device\fR, \fIdirectory\fR, \fIfile\fR. The following operands are supported: .sp .ne 2 .na \fB\fIblock_device\fR\fR .ad .sp .6 .RS 4n Represents a block special device (for example, \fB/dev/dsk/c1d0s7\fR). .RE .sp .ne 2 .na \fB\fIdirectory\fR\fR .ad .sp .6 .RS 4n Represents a valid directory name. \fBdf\fR reports on the file system that contains \fIdirectory\fR. .RE .sp .ne 2 .na \fB\fIfile\fR\fR .ad .sp .6 .RS 4n Represents a valid file name. \fBdf\fR reports on the file system that contains \fIfile\fR. .RE .sp .ne 2 .na \fB\fIresource\fR\fR .ad .sp .6 .RS 4n Represents an \fBNFS\fR resource name. .RE .SH USAGE .LP See \fBlargefile\fR(7) for the description of the behavior of \fBdf\fR when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). .SH EXAMPLES .LP \fBExample 1 \fRExecuting the \fBdf\fR command .sp .LP The following example shows the \fBdf\fR command and its output: .sp .in +2 .nf example% \fB/usr/bin/df\fR / (/dev/dsk/c0t0d0s0 ): 287530 blocks 92028 files /system/contract (ctfs ): 0 blocks 2147483572 files /system/object (objfs ): 0 blocks 2147483511 files /usr (/dev/dsk/c0t0d0s6 ): 1020214 blocks 268550 files /proc (/proc ): 0 blocks 878 files /dev/fd (fd ): 0 blocks 0 files /etc/mnttab (mnttab ): 0 blocks 0 files /var/run (swap ): 396016 blocks 9375 files /tmp (swap ): 396016 blocks 9375 files /opt (/dev/dsk/c0t0d0s5 ): 381552 blocks 96649 files /export/home (/dev/dsk/c0t0d0s7 ): 434364 blocks 108220 files .fi .in -2 .sp .sp .LP where the columns represent the mount point, device (or "filesystem", according to \fBdf\fR \fB-k\fR), free blocks, and free files, respectively. For contract file systems, \fB/system/contract\fR is the mount point, \fBctfs\fR is the contract file system (used by \fBSMF\fR) with 0 free blocks and 2147483582(\fBINTMAX\fR-1) free files. For object file systems, \fB/system/object\fR is the mount point, \fBobjfs\fR is the object file system (see \fBobjfs\fR(4FS)) with 0 free blocks and 2147483511 free files. .LP \fBExample 2 \fRWriting Portable Information About the \fB/usr\fR File System .sp .LP The following example writes portable information about the \fB/usr\fR file system: .sp .in +2 .nf example% \fB/usr/bin/df -P /usr\fR .fi .in -2 .sp .LP \fBExample 3 \fRWriting Portable Information About the \fB/usr/src\fR file System .sp .LP Assuming that \fB/usr/src\fR is part of the \fB/usr\fR file system, the following example writes portable information : .sp .in +2 .nf example% \fB/usr/bin/df -P /usr/src\fR .fi .in -2 .sp .LP \fBExample 4 \fRUsing \fBdf\fR to Display Inode Usage .sp .LP The following example displays inode usage on all \fBufs\fR file systems: .sp .in +2 .nf example%\fB/usr/bin/df -F ufs -o i\fR .fi .in -2 .sp .SH ENVIRONMENT VARIABLES .LP See \fBenviron\fR(7) for descriptions of the following environment variables that affect the execution of \fBdf\fR: \fBLANG\fR, \fBLC_ALL\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR. .SH EXIT STATUS .LP The following exit values are returned: .sp .ne 2 .na \fB\fB0\fR\fR .ad .sp .6 .RS 4n Successful completion. .RE .sp .ne 2 .na \fB\fB>0\fR\fR .ad .sp .6 .RS 4n An error occurred. .RE .SH FILES .ne 2 .na \fB\fB/dev/dsk/*\fR\fR .ad .sp .6 .RS 4n Disk devices .RE .sp .ne 2 .na \fB\fB/etc/default/fs\fR\fR .ad .sp .6 .RS 4n Default local file system type. Default values can be set for the following flags in \fB/etc/default/fs\fR. For example: \fBLOCAL=ufs\fR, where \fBLOCAL\fR is the default partition for a command if no FSType is specified. .RE .sp .ne 2 .na \fB\fB/etc/mnttab\fR\fR .ad .sp .6 .RS 4n Mount table .RE .sp .ne 2 .na \fB\fB/etc/vfstab\fR\fR .ad .sp .6 .RS 4n List of default parameters for each file system .RE .SH ATTRIBUTES .LP See \fBattributes\fR(7) for descriptions of the following attributes: .TS box; c | c l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Standard .TE .SH SEE ALSO .LP .BR find (1), .BR statvfs (2), .BR objfs (4FS), .BR default_fs (5), .BR mnttab (5), .BR vfstab (5), .BR attributes (7), .BR environ (7), .BR largefile (7), .BR standards (7), .BR df_ufs (8), .BR mount (8) .SH NOTES .LP If \fBUFS\fR logging is enabled on a file system, the disk space used for the log is reflected in the \fBdf\fR report. The log is allocated from free blocks on the file system, and it is sized approximately \fB1\fR Mbyte per \fB1\fR Gbyte of file system, up to 256 Mbytes. The log size may be larger (up to a maximum of 512 Mbytes) depending on the number of cylinder groups present in the file system.