xref: /openbsd-src/bin/df/df.1 (revision d9f757ce0c087fede167f49361391585cd618e1d)
1*d9f757ceSmillert.\"	$OpenBSD: df.1,v 1.49 2022/12/31 21:47:53 millert Exp $
2af0beca9Sderaadt.\"	$NetBSD: df.1,v 1.12 1995/12/05 02:42:45 jtc Exp $
3df930be7Sderaadt.\"
4df930be7Sderaadt.\" Copyright (c) 1989, 1990, 1993
5df930be7Sderaadt.\"	The Regents of the University of California.  All rights reserved.
6df930be7Sderaadt.\"
7df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without
8df930be7Sderaadt.\" modification, are permitted provided that the following conditions
9df930be7Sderaadt.\" are met:
10df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright
11df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer.
12df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright
13df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer in the
14df930be7Sderaadt.\"    documentation and/or other materials provided with the distribution.
1529295d1cSmillert.\" 3. Neither the name of the University nor the names of its contributors
16df930be7Sderaadt.\"    may be used to endorse or promote products derived from this software
17df930be7Sderaadt.\"    without specific prior written permission.
18df930be7Sderaadt.\"
19df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22df930be7Sderaadt.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29df930be7Sderaadt.\" SUCH DAMAGE.
30df930be7Sderaadt.\"
31df930be7Sderaadt.\"	@(#)df.1	8.2 (Berkeley) 1/13/92
32df930be7Sderaadt.\"
33*d9f757ceSmillert.Dd $Mdocdate: December 31 2022 $
34df930be7Sderaadt.Dt DF 1
35fc8533a3Saaron.Os
36df930be7Sderaadt.Sh NAME
37df930be7Sderaadt.Nm df
38df930be7Sderaadt.Nd display free disk space
39df930be7Sderaadt.Sh SYNOPSIS
407349792aSaaron.Nm df
41002a8840Sderaadt.Op Fl hiklnP
42df930be7Sderaadt.Op Fl t Ar type
433d76386bSaaron.Oo
443d76386bSaaron.Op Ar file | file_system
453d76386bSaaron.Ar ...
463d76386bSaaron.Oc
47df930be7Sderaadt.Sh DESCRIPTION
4818611b21SaaronThe
49f11c8a18Saaron.Nm
5018611b21Saaronutility displays statistics about the amount of free disk space on the
5118611b21Saaronspecified
52df930be7Sderaadt.Ar file_system
53df930be7Sderaadtor on the file system of which
54df930be7Sderaadt.Ar file
55df930be7Sderaadtis a part.
5621107fc2SjmcBy default, values are displayed as 512-byte block counts.
57121e4997SjmcIf no operands are specified,
58df930be7Sderaadtstatistics for all mounted file systems are displayed
59df930be7Sderaadt(subject to the
60df930be7Sderaadt.Fl l
61df930be7Sderaadtand
62df930be7Sderaadt.Fl t
63121e4997Sjmcoptions, below).
64df930be7Sderaadt.Pp
658cf461a5SaaronThe options are as follows:
66df930be7Sderaadt.Bl -tag -width Ds
67df7246c2Skstailey.It Fl h
688c926583Saaron"Human-readable" output.
698c926583SaaronUse unit suffixes: Byte, Kilobyte, Megabyte,
70df7246c2SkstaileyGigabyte, Terabyte, Petabyte, Exabyte in order to reduce the number of
714af0392eSkstaileydigits to four or less.
72c7c3a869SjmcThis option is incompatible with the
73c7c3a869Sjmc.Fl P
74c7c3a869Sjmcoption.
75df930be7Sderaadt.It Fl i
76df930be7SderaadtInclude statistics on the number of free inodes.
77c7c3a869SjmcThis option is incompatible with the
78c7c3a869Sjmc.Fl P
79c7c3a869Sjmcoption.
80df930be7Sderaadt.It Fl k
81df930be7SderaadtBy default, all sizes are reported in 512-byte block counts.
82df930be7SderaadtThe
83df930be7Sderaadt.Fl k
84df930be7Sderaadtoption causes the numbers to be reported in kilobyte counts.
85df930be7Sderaadt.It Fl l
86b11b8f70SaaronDisplay statistics only about mounted file systems with the
87b11b8f70Saaron.Dv MNT_LOCAL
888c926583Saaronflag set.
898c926583SaaronIf a non-local file system is given as an argument, a
9072b1a773Sderaadtwarning is issued and no information is given on that file system.
91df930be7Sderaadt.It Fl n
92df930be7SderaadtPrint out the previously obtained statistics from the file systems.
93df930be7SderaadtThis option should be used if it is possible that one or more
94df930be7Sderaadtfile systems are in a state such that they will not be able to provide
95df930be7Sderaadtstatistics without a long delay.
96df930be7SderaadtWhen this option is specified,
97f11c8a18Saaron.Nm
98df930be7Sderaadtwill not request new statistics from the file systems, but will respond
99df930be7Sderaadtwith the possibly stale statistics that were previously obtained.
10011847371Sdenny.It Fl P
10111847371SdennyPrint out information in a stricter format designed to be parsed
10211847371Sdennyby portable scripts.
103*d9f757ceSmillertThe
104*d9f757ceSmillert.Ev BLOCKSIZE
105*d9f757ceSmillertenvironment variable is ignored when this option is specified.
106df930be7Sderaadt.It Fl t Ar type
107dd240d3cSaaronIndicate the actions should only be taken on
108dd240d3cSaaronfile systems of the specified
109dd240d3cSaaron.Ar type .
11021107fc2SjmcMore than one type may be specified in a comma-separated list.
111df930be7SderaadtThe list of file system types can be prefixed with
112df930be7Sderaadt.Dq no
113df930be7Sderaadtto specify the file system types for which action should
114df930be7Sderaadt.Em not
1158c926583Saaronbe taken.
1168c926583SaaronIf a file system is given on the command line that is not of
11772b1a773Sderaadtthe specified type, a warning is issued and no information is given on
11872b1a773Sderaadtthat file system.
119df930be7Sderaadt.El
12025d1da39Sjmc.Pp
12197fa81fcSjmcIt is not an error to specify more than one of
12297fa81fcSjmcthe mutually exclusive options
12397fa81fcSjmc.Fl h
12497fa81fcSjmcand
12597fa81fcSjmc.Fl k .
12697fa81fcSjmcWhere more than one of these options is specified,
12797fa81fcSjmcthe last option given overrides the others.
12841371632Sderaadt.Sh ENVIRONMENT
129df930be7Sderaadt.Bl -tag -width BLOCKSIZE
130df930be7Sderaadt.It Ev BLOCKSIZE
131*d9f757ceSmillertDisplay block counts in units of size
132*d9f757ceSmillert.Dv BLOCKSIZE .
133*d9f757ceSmillertIgnored if any of the
134*d9f757ceSmillert.Fl h , k
13595da381cSjmcor
136*d9f757ceSmillert.Fl P
137*d9f757ceSmillertoptions are specified.
138df930be7Sderaadt.El
13959a5f2b9Sjmc.Sh EXIT STATUS
14059a5f2b9Sjmc.Ex -std df
141952971feSjmc.Sh EXAMPLES
142952971feSjmcOutput, in a strict format suitable for portable scripts, disk space
143952971feSjmcstatistics for the
144952971feSjmc.Pa /usr
14525d1da39Sjmcfile system using kilobyte block sizes:
146b34cc4e8Smillert.Pp
14725d1da39Sjmc.Dl $ df -kP /usr
148df930be7Sderaadt.Sh SEE ALSO
149df930be7Sderaadt.Xr quota 1 ,
150df930be7Sderaadt.Xr getfsstat 2 ,
151ca961342Saaron.Xr statfs 2 ,
152df930be7Sderaadt.Xr getmntinfo 3 ,
153df930be7Sderaadt.Xr fstab 5 ,
154df930be7Sderaadt.Xr mount 8 ,
155df930be7Sderaadt.Xr quot 8
15611847371Sdenny.Sh STANDARDS
15711847371SdennyThe
158f11c8a18Saaron.Nm
15911847371Sdennyutility is compliant with the
16099332e38Sjmc.St -p1003.1-2008
16111847371Sdennyspecification.
162f9e94bd9Sjmc.Pp
163f9e94bd9SjmcThe flags
1649a556684Sjmc.Op Fl hiln ,
1659a556684Sjmcas well as the
1669a556684Sjmc.Ev BLOCKSIZE
1679a556684Sjmcenvironment variable,
1680f3f4dbcSjmcare extensions to that specification.
1698d7df9c0Sjmc.Pp
1705a4e8c02SjmcThis implementation provides the traditional
171121e4997Sjmc.Bx
1728d7df9c0Sjmc.Fl t
173121e4997Sjmcbehaviour,
174121e4997Sjmcwhich differs from the
175121e4997SjmcX/Open System Interfaces option
176121e4997Sjmcspecification.
177df930be7Sderaadt.Sh HISTORY
178df930be7SderaadtA
179f11c8a18Saaron.Nm
180df930be7Sderaadtutility appeared in
1813a0c2a3aSschwarze.At v1 .
182