xref: /netbsd-src/bin/df/df.1 (revision dd3ee07da436799d8de85f3055253118b76bf345)
1.\"	$NetBSD: df.1,v 1.56 2021/01/06 20:38:09 ginsbach Exp $
2.\"
3.\" Copyright (c) 1989, 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"	@(#)df.1	8.2 (Berkeley) 1/13/92
31.\"
32.Dd January 2, 2021
33.Dt DF 1
34.Os
35.Sh NAME
36.Nm df
37.Nd display free disk space
38.Sh SYNOPSIS
39.Nm
40.Op Fl acglnW
41.Op Fl Ghkm | Fl ihkm | Fl Pk
42.Op Fl t Ar type
43.Op Ar file | Ar file_system ...
44.Sh DESCRIPTION
45.Nm
46displays statistics about the amount of free disk space on the specified
47.Ar file_system
48or on the file system of which
49.Ar file
50is a part.
51By default, all sizes are reported in 512-byte block counts.
52If neither a file or a
53.Ar file_system
54operand is specified,
55statistics for all mounted file systems are displayed
56(subject to the
57.Fl l
58and
59.Fl t
60options below).
61.Pp
62Note that the printed count of available blocks takes
63.Va minfree
64into account, and thus will be negative when the number of free blocks
65on the file system is less than
66.Va minfree .
67.Pp
68The following options are available:
69.Bl -tag -width Ds
70.It Fl a
71Show all mount points,
72including those that were mounted with the
73.Dv MNT_IGNORE
74flag.
75.It Fl c
76Display a grand total for all shown mount points.
77.It Fl G
78Display all the fields of the structure(s) returned by
79.Xr statvfs 2 .
80This option cannot be used with the
81.Fl i
82or
83.Fl P
84options, and it is modelled after the Solaris
85.Fl g
86option.
87This option will override the
88.Fl g ,
89.Fl h ,
90.Fl k ,
91and
92.Fl m
93options, as well as any setting of
94.Ev BLOCKSIZE .
95.It Fl g
96The
97.Fl g
98option causes the numbers to be reported in gigabytes (1024*1024*1024
99bytes).
100.It Fl h
101"Human-readable" output.
102Use unit suffixes: Byte, Kilobyte, Megabyte,
103Gigabyte, Terabyte, Petabyte, Exabyte in order to reduce the number of
104digits to four or less.
105.It Fl i
106Include statistics on the number of free inodes.
107.It Fl k
108By default, all sizes are reported in 512-byte block counts.
109The
110.Fl k
111option causes the numbers to be reported in kilobytes (1024 bytes).
112.It Fl l
113Display statistics only about mounted file systems with the
114.Dv MNT_LOCAL
115flag set.
116If a non-local file system is given as an argument, a
117warning is issued and no information is given on that file system.
118.It Fl m
119The
120.Fl m
121option causes the numbers to be reported in megabytes (1024*1024 bytes).
122.It Fl n
123Print out the previously obtained statistics from the file systems.
124This option should be used if it is possible that one or more
125file systems are in a state such that they will not be able to provide
126statistics without a long delay.
127When this option is specified,
128.Nm
129will not request new statistics from the file systems, but will respond
130with the possibly stale statistics that were previously obtained.
131.It Fl P
132Produce output in the following portable format:
133.Pp
134If both the
135.Fl P
136and
137.Fl k
138option are specified, the output will be preceded by the following header
139line, formatted to match the data following it:
140.Bd -literal
141"Filesystem 1024-blocks Used Available Capacity Mounted on\en"
142.Ed
143.Pp
144If the
145.Fl P
146option is specified without the
147.Fl k
148options, the output will be preceded by the following header line,
149formatted to match the data following it:
150.Bd -literal
151"Filesystem <blksize>-blocks Used Available Capacity Mounted on\en"
152.Ed
153.Pp
154The header line is followed by data formatted as follows:
155.Bd -literal
156"%s %d %d %d %d%% %s\en", <file system name>, <total space>,
157    <space used>, <space free>, <percentage used>,
158    <file system root>
159.Ed
160.Pp
161Note that the
162.Fl i
163option may not be specified with
164.Fl P .
165.It Fl t Ar type
166Is used to indicate the actions should only be taken on
167file systems of the specified type.
168More than one type may be specified in a comma-separated list.
169The list of file system types can be prefixed with
170.Dq no
171to specify the file system types for which action should
172.Em not
173be taken.
174If a file system is given on the command line that is not of
175the specified type, a warning is issued and no information is given on
176that file system.
177.It Fl W
178Print the wedge name instead of the mounted from device for wedges.
179The wedge name is prefixed with
180.Dq NAME=
181as in
182.Xr fstab 5 .
183If the wedge information cannot be obtained for one or more
184file systems, the
185.Fl W
186option is silently ignored for those file systems.
187.El
188.Sh ENVIRONMENT
189.Bl -tag -width BLOCKSIZE
190.It Ev BLOCKSIZE
191If the environment variable
192.Ev BLOCKSIZE
193is set, and the
194.Fl g ,
195.Fl h ,
196.Fl k
197and
198.Fl m
199options are not specified, the block counts will be displayed in units of that
200size block.
201.El
202.Sh SEE ALSO
203.Xr quota 1 ,
204.Xr fstatvfs 2 ,
205.Xr getvfsstat 2 ,
206.Xr statvfs 2 ,
207.Xr getbsize 3 ,
208.Xr getmntinfo 3 ,
209.Xr fs 5 ,
210.Xr fstab 5 ,
211.Xr mount 8 ,
212.Xr quot 8 ,
213.Xr tunefs 8
214.Sh HISTORY
215A
216.Nm
217utility appeared in
218.At v1 .
219