1*b4ff2f24Skre.\" $NetBSD: df.1,v 1.60 2024/08/03 05:27:58 kre Exp $ 23ce29a4cSwiz.\" 39c2fbdc2Smycroft.\" Copyright (c) 1989, 1990, 1993 49c2fbdc2Smycroft.\" The Regents of the University of California. All rights reserved. 561f28255Scgd.\" 661f28255Scgd.\" Redistribution and use in source and binary forms, with or without 761f28255Scgd.\" modification, are permitted provided that the following conditions 861f28255Scgd.\" are met: 961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright 1061f28255Scgd.\" notice, this list of conditions and the following disclaimer. 1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright 1261f28255Scgd.\" notice, this list of conditions and the following disclaimer in the 1361f28255Scgd.\" documentation and/or other materials provided with the distribution. 14b5b29542Sagc.\" 3. Neither the name of the University nor the names of its contributors 1561f28255Scgd.\" may be used to endorse or promote products derived from this software 1661f28255Scgd.\" without specific prior written permission. 1761f28255Scgd.\" 1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2161f28255Scgd.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2861f28255Scgd.\" SUCH DAMAGE. 2961f28255Scgd.\" 3049f0ad86Scgd.\" @(#)df.1 8.2 (Berkeley) 1/13/92 31346aa5ddScgd.\" 32*b4ff2f24Skre.Dd August 3, 2024 3361f28255Scgd.Dt DF 1 34f1247650Sgarbled.Os 3561f28255Scgd.Sh NAME 3661f28255Scgd.Nm df 3761f28255Scgd.Nd display free disk space 3861f28255Scgd.Sh SYNOPSIS 39c3872193Senami.Nm 40*b4ff2f24Skre.Op Fl aclMnqW 413ce29a4cSwiz.Op Fl G | Fl bkP | Fl bfgHhikmN 42720e7294Smycroft.Op Fl t Ar type 432c3bf36bSkre.Oo Ar file | Ar file_system Oc Ns ... 4461f28255Scgd.Sh DESCRIPTION 45c3872193Senami.Nm 4661f28255Scgddisplays statistics about the amount of free disk space on the specified 47720e7294Smycroft.Ar file_system 4861f28255Scgdor on the file system of which 4961f28255Scgd.Ar file 5061f28255Scgdis a part. 513cd33047SwizBy default, all sizes are reported in 512-byte block counts. 52720e7294SmycroftIf neither a file or a 53720e7294Smycroft.Ar file_system 54720e7294Smycroftoperand is specified, 552c3bf36bSkrestatistics for all mounted, 562c3bf36bSkreand not hidden (i.e.: not mounted with 572c3bf36bSkre.Dv MNT_IGNORE ) , 582c3bf36bSkrefile systems are displayed 599c2fbdc2Smycroft(subject to the 602c3bf36bSkre.Fl a , 619c2fbdc2Smycroft.Fl l 62720e7294Smycroftand 63720e7294Smycroft.Fl t 64720e7294Smycroftoptions below). 6561f28255Scgd.Pp 662335d45eScjsNote that the printed count of available blocks takes 672335d45eScjs.Va minfree 682335d45eScjsinto account, and thus will be negative when the number of free blocks 692335d45eScjson the file system is less than 702335d45eScjs.Va minfree . 712335d45eScjs.Pp 7261f28255ScgdThe following options are available: 7361f28255Scgd.Bl -tag -width Ds 7454d8f9ccSchristos.It Fl a 752c3bf36bSkreIf no 762c3bf36bSkre.Ar file , 772c3bf36bSkreor 782c3bf36bSkre.Ar file_system 798acfa249Skrearguments are given, show all mount points, 80330b2b8eSwizincluding those that were mounted with the 8154d8f9ccSchristos.Dv MNT_IGNORE 82330b2b8eSwizflag. 832c3bf36bSkreNote that for file systems specified on the command 842c3bf36bSkreline, that mount option is never considered. 852c3bf36bSkre.It Fl b 862c3bf36bSkreShow space as units of basic blocks (512 bytes). 872c3bf36bSkreThis is normally the default; this option can be used to 882c3bf36bSkreoverride a conflicting setting in the environment variable 892c3bf36bSkre.Ev BLOCKSIZE . 90f40edf74Sginsbach.It Fl c 91f40edf74SginsbachDisplay a grand total for all shown mount points. 922c3bf36bSkreWhen combined with 932c3bf36bSkre.Fl f 942c3bf36bSkreonly the total for the mount points which otherwise 952c3bf36bSkrewould be included is shown, not the individual entries. 962c3bf36bSkre.It Fl f 972c3bf36bSkreDisplay only the available free space (or with 982c3bf36bSkre.Fl i , 992c3bf36bSkrefree inodes) in a minimal format. 1002c3bf36bSkreWhen there is to be only one line of output, only the value 1012c3bf36bSkreis shown, otherwise the value and the mount point, 1022c3bf36bSkreseparated by a single space, are printed. 1032c3bf36bSkreFor free space, the 1042c3bf36bSkre.Fl b , 1052c3bf36bSkre.Fl g , 1062c3bf36bSkre.Fl H , 1072c3bf36bSkre.Fl h , 1082c3bf36bSkre.Fl k 1092c3bf36bSkreand 1102c3bf36bSkre.Fl m 1112c3bf36bSkreoptions, and 1122c3bf36bSkre.Ev BLOCKSIZE 1132c3bf36bSkreare all used as normal. 1142c3bf36bSkreThis option implies 1152c3bf36bSkre.Fl N 1162c3bf36bSkreand is incompatible with 1172c3bf36bSkre.Fl P 1182c3bf36bSkreand 1192c3bf36bSkre.Fl G . 1207ca37f5cSchristos.It Fl G 12198d59412SchristosDisplay all the fields of the structure(s) returned by 12298d59412Schristos.Xr statvfs 2 . 12398d59412SchristosThis option cannot be used with the 1242c3bf36bSkre.Fl f , 12598d59412Schristos.Fl i 12698d59412Schristosor 12798d59412Schristos.Fl P 1282c3bf36bSkreoptions, and is modelled after the Solaris 1297ca37f5cSchristos.Fl g 1307ca37f5cSchristosoption. 13198d59412SchristosThis option will override the 1322c3bf36bSkre.Fl b , 1337ca37f5cSchristos.Fl g , 1342c3bf36bSkre.Fl H , 13598d59412Schristos.Fl h , 1362c3bf36bSkre.Fl k 13798d59412Schristosand 13898d59412Schristos.Fl m 13998d59412Schristosoptions, as well as any setting of 14098d59412Schristos.Ev BLOCKSIZE . 141935753c8Schristos.It Fl g 142935753c8SchristosThe 143935753c8Schristos.Fl g 1442c3bf36bSkreoption causes size numbers to be reported in gigabytes (1024*1024*1024 145935753c8Schristosbytes). 1464fd29e5dSprovos.It Fl h 1472c3bf36bSkreUse 1482c3bf36bSkre.Dq human-readable 1492c3bf36bSkreoutput for space data. 1504fd29e5dSprovosUse unit suffixes: Byte, Kilobyte, Megabyte, 1514fd29e5dSprovosGigabyte, Terabyte, Petabyte, Exabyte in order to reduce the number of 1524fd29e5dSprovosdigits to four or less. 1532c3bf36bSkre.It Fl H 1542c3bf36bSkreAs with 1552c3bf36bSkre.Fl h 1562c3bf36bSkrebut using powers of 10 (1000) rather than 2 (1024). 15761f28255Scgd.It Fl i 15861f28255ScgdInclude statistics on the number of free inodes. 1592c3bf36bSkreWhen combined with 1602c3bf36bSkre.Fl f 1612c3bf36bSkreonly the number of free inodes is shown. 16261f28255Scgd.It Fl k 1632c3bf36bSkreBy default, all sizes are reported in 512-byte block counts, 1642c3bf36bSkreunless the 1652c3bf36bSkre.Ev BLOCKSIZE 1662c3bf36bSkreenvironment variable is set. 16761f28255ScgdThe 16861f28255Scgd.Fl k 1692c3bf36bSkreoption causes the size numbers to be reported in kilobytes (1024 bytes). 170a988dc6cSmycroft.It Fl l 17154d8f9ccSchristosDisplay statistics only about mounted file systems with the 17254d8f9ccSchristos.Dv MNT_LOCAL 17314dfaa4bSwizflag set. 17414dfaa4bSwizIf a non-local file system is given as an argument, a 1750097f7bcSthorpejwarning is issued and no information is given on that file system. 176*b4ff2f24Skre.It Fl M 177*b4ff2f24SkreEach 178*b4ff2f24Skre.Ar file 179*b4ff2f24Skre.Pq or Ar file_system 180*b4ff2f24Skrespecified as an argument must give a path to a mount point 181*b4ff2f24Skrein the tree, at which a file system is currently mounted. 182*b4ff2f24SkreInformation for that mounted file system is, if not otherwise 183*b4ff2f24Skreexcluded, provided. 184*b4ff2f24SkreIf a 185*b4ff2f24Skre.Ar file 186*b4ff2f24Skrewhich does not name a mount point is specified, 187*b4ff2f24Skrea warning is issued, 188*b4ff2f24Skreand no information is given for the file system on which that 189*b4ff2f24Skre.Ar file 190*b4ff2f24Skreresides (unless some other 191*b4ff2f24Skre.Ar file 192*b4ff2f24Skrenames its mount point). 193a76b375cSjdolecek.It Fl m 194a76b375cSjdolecekThe 195a76b375cSjdolecek.Fl m 1962c3bf36bSkreoption causes size numbers to be reported in megabytes (1024*1024 bytes). 1972c3bf36bSkre.It Fl N 1982c3bf36bSkreSuppress the header line normally output. 1992c3bf36bSkreThis option is ignored with 2002c3bf36bSkre.Fl G 2012c3bf36bSkrewhich has no header line to ignore, 2022c3bf36bSkreand with 2032c3bf36bSkre.Fl P 2042c3bf36bSkrewhich requires the header line to maintain 2052c3bf36bSkrethe portable format it is designed to emulate. 20661f28255Scgd.It Fl n 20761f28255ScgdPrint out the previously obtained statistics from the file systems. 20861f28255ScgdThis option should be used if it is possible that one or more 20961f28255Scgdfile systems are in a state such that they will not be able to provide 21061f28255Scgdstatistics without a long delay. 21161f28255ScgdWhen this option is specified, 212c3872193Senami.Nm 21361f28255Scgdwill not request new statistics from the file systems, but will respond 21461f28255Scgdwith the possibly stale statistics that were previously obtained. 215bd6b91bdSkleink.It Fl P 216bd6b91bdSkleinkProduce output in the following portable format: 217bd6b91bdSkleink.Pp 2182c3bf36bSkreThe output will be preceded by the following header line: 219bd6b91bdSkleink.Bd -literal 22001869ca4Swiz"Filesystem <blksize>-blocks Used Available Capacity Mounted on\en" 221bd6b91bdSkleink.Ed 222bd6b91bdSkleink.Pp 223bd6b91bdSkleinkThe header line is followed by data formatted as follows: 224bd6b91bdSkleink.Bd -literal 22501869ca4Swiz"%s %d %d %d %d%% %s\en", <file system name>, <total space>, 22601869ca4Swiz <space used>, <space free>, <percentage used>, 22701869ca4Swiz <file system root> 228bd6b91bdSkleink.Ed 22998d59412Schristos.Pp 23098d59412SchristosNote that the 23198d59412Schristos.Fl i 23298d59412Schristosoption may not be specified with 2332c3bf36bSkre.Fl P , 2342c3bf36bSkreand the 2352c3bf36bSkre.Ar blksize 2362c3bf36bSkreis required to be 512 or 1024. 237*b4ff2f24Skre.It Fl q 238*b4ff2f24SkreSuppress all warning output. 239cfbbe9b7Smycroft.It Fl t Ar type 240cfbbe9b7SmycroftIs used to indicate the actions should only be taken on 241cfbbe9b7Smycroftfile systems of the specified type. 2421cb1c328SwizMore than one type may be specified in a comma-separated list. 243cfbbe9b7SmycroftThe list of file system types can be prefixed with 244cfbbe9b7Smycroft.Dq no 245cfbbe9b7Smycroftto specify the file system types for which action should 246cfbbe9b7Smycroft.Em not 24714dfaa4bSwizbe taken. 24814dfaa4bSwizIf a file system is given on the command line that is not of 2490097f7bcSthorpejthe specified type, a warning is issued and no information is given on 2500097f7bcSthorpejthat file system. 251d06f528cSchristos.It Fl W 252d06f528cSchristosPrint the wedge name instead of the mounted from device for wedges. 253d06f528cSchristosThe wedge name is prefixed with 254d06f528cSchristos.Dq NAME= 255d06f528cSchristosas in 256d06f528cSchristos.Xr fstab 5 . 257104d898eSchristosIf the wedge information cannot be obtained for one or more 258dc03ac3fSchristosfile systems, the 259d83135ebSwiz.Fl W 260d83135ebSwizoption is silently ignored for those file systems. 26161f28255Scgd.El 2622c3bf36bSkre.Pp 2632c3bf36bSkreIf more than one of 2642c3bf36bSkre.Fl b , 2652c3bf36bSkre.Fl g , 2662c3bf36bSkre.Fl H , 2672c3bf36bSkre.Fl h , 2682c3bf36bSkre.Fl k 2692c3bf36bSkreor 2703ce29a4cSwiz.Fl m 2712c3bf36bSkreis given, the last of those specified is used. 2726fa1adeaSwiz.Sh ENVIRONMENT 273a78a8ce5Smycroft.Bl -tag -width BLOCKSIZE 274a78a8ce5Smycroft.It Ev BLOCKSIZE 2759a3ca97fSjtcIf the environment variable 276a78a8ce5Smycroft.Ev BLOCKSIZE 2772c3bf36bSkreis set, and none of the 2782c3bf36bSkre.Fl b , 2797ca37f5cSchristos.Fl g , 2802c3bf36bSkre.Fl H , 2819d454b9eSperry.Fl h , 2829d454b9eSperry.Fl k 283eff007b2Sgrantand 2849d454b9eSperry.Fl m 2852c3bf36bSkreoptions are specified, 2862c3bf36bSkrethe block counts will be displayed in units of that size block. 287a78a8ce5Smycroft.El 28861f28255Scgd.Sh SEE ALSO 28961f28255Scgd.Xr quota 1 , 290f85aae56Schristos.Xr fstatvfs 2 , 291f85aae56Schristos.Xr getvfsstat 2 , 29255bf8ce8Swiz.Xr statvfs 2 , 29379f5a137Ssimonb.Xr getbsize 3 , 29461f28255Scgd.Xr getmntinfo 3 , 2952c3bf36bSkre.Xr humanize_number 3 , 2966fa1adeaSwiz.Xr fs 5 , 29761f28255Scgd.Xr fstab 5 , 29861f28255Scgd.Xr mount 8 , 2992335d45eScjs.Xr quot 8 , 300751ea7cdSbouyer.Xr tunefs 8 30161f28255Scgd.Sh HISTORY 30261f28255ScgdA 303c3872193Senami.Nm 30423e6aab1Sjtcutility appeared in 305e687bdc5Ssevan.At v1 . 3062c3bf36bSkreThe 3072c3bf36bSkre.Fl f 3082c3bf36bSkreoption was added in 3092c3bf36bSkre.Nx 10 . 310