19ddb49cbSWarner Losh.\"- 24b88c807SRodney W. Grimes.\" Copyright (c) 1989, 1990, 1993 34b88c807SRodney W. Grimes.\" The Regents of the University of California. All rights reserved. 44b88c807SRodney W. Grimes.\" 54b88c807SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without 64b88c807SRodney W. Grimes.\" modification, are permitted provided that the following conditions 74b88c807SRodney W. Grimes.\" are met: 84b88c807SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright 94b88c807SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer. 104b88c807SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright 114b88c807SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer in the 124b88c807SRodney W. Grimes.\" documentation and/or other materials provided with the distribution. 13fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors 144b88c807SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 154b88c807SRodney W. Grimes.\" without specific prior written permission. 164b88c807SRodney W. Grimes.\" 174b88c807SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 184b88c807SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 194b88c807SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 204b88c807SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 214b88c807SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 224b88c807SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 234b88c807SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 244b88c807SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 254b88c807SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 264b88c807SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 274b88c807SRodney W. Grimes.\" SUCH DAMAGE. 284b88c807SRodney W. Grimes.\" 29c33db74bSStefan Eßer.Dd March 29, 2023 304b88c807SRodney W. Grimes.Dt DF 1 31caa2db3bSRuslan Ermilov.Os 324b88c807SRodney W. Grimes.Sh NAME 334b88c807SRodney W. Grimes.Nm df 344b88c807SRodney W. Grimes.Nd display free disk space 354b88c807SRodney W. Grimes.Sh SYNOPSIS 36be8b1497SRuslan Ermilov.Nm 376fea8dc8SMarcel Moolenaar.Op Fl -libxo 382360f509SRuslan Ermilov.Op Fl b | g | H | h | k | m | P 39b56ca465SPawel Jakub Dawidek.Op Fl acilnT 407eb55d4dSXin LI.Op Fl \&, 414b88c807SRodney W. Grimes.Op Fl t Ar type 42d0353b83SRuslan Ermilov.Op Ar file | filesystem ... 434b88c807SRodney W. Grimes.Sh DESCRIPTION 44e004acc8SPhilippe CharnierThe 45e004acc8SPhilippe Charnier.Nm 46e004acc8SPhilippe Charnierutility 474b88c807SRodney W. Grimesdisplays statistics about the amount of free disk space on the specified 481740c2dbSMark Johnstonmounted 494b88c807SRodney W. Grimes.Ar file system 504b88c807SRodney W. Grimesor on the file system of which 514b88c807SRodney W. Grimes.Ar file 524b88c807SRodney W. Grimesis a part. 5371cfc678SGreg LeheyBy default block counts are displayed with an assumed block size of 5471cfc678SGreg Lehey512 bytes. 554b88c807SRodney W. GrimesIf neither a file or a file system operand is specified, 564b88c807SRodney W. Grimesstatistics for all mounted file systems are displayed 574b88c807SRodney W. Grimes(subject to the 584b88c807SRodney W. Grimes.Fl t 594b88c807SRodney W. Grimesoption below). 604b88c807SRodney W. Grimes.Pp 614b88c807SRodney W. GrimesThe following options are available: 62975ab359SRuslan Ermilov.Bl -tag -width indent 6306691045SCraig Rodrigues.It Fl -libxo 6406691045SCraig RodriguesGenerate output via 6506691045SCraig Rodrigues.Xr libxo 3 6606691045SCraig Rodriguesin a selection of different human and machine readable formats. 6706691045SCraig RodriguesSee 6806691045SCraig Rodrigues.Xr xo_parse_args 3 6906691045SCraig Rodriguesfor details on command line arguments. 705b42dac8SJulian Elischer.It Fl a 71975ab359SRuslan ErmilovShow all mount points, including those that were mounted with the 72975ab359SRuslan Ermilov.Dv MNT_IGNORE 735b42dac8SJulian Elischerflag. 7416352ac8SDag-Erling SmørgravThis is implied for file systems specified on the command line. 75dd6d33e8SMichael Haro.It Fl b 7671cfc678SGreg LeheyExplicitly use 512 byte blocks, overriding any 77dd6d33e8SMichael Haro.Ev BLOCKSIZE 78dd6d33e8SMichael Harospecification from the environment. 7971cfc678SGreg LeheyThis is the same as the 8071cfc678SGreg Lehey.Fl P 8171cfc678SGreg Leheyoption. 8271cfc678SGreg LeheyThe 8371cfc678SGreg Lehey.Fl k 8471cfc678SGreg Leheyoption overrides this option. 85076419d2SDavid E. O'Brien.It Fl c 86076419d2SDavid E. O'BrienDisplay a grand total. 8793a3fa19SJohn W. De Boskey.It Fl g 8871cfc678SGreg LeheyUse 1073741824 byte (1 Gibibyte) blocks rather than the default. 8971cfc678SGreg LeheyThis overrides any 9093a3fa19SJohn W. De Boskey.Ev BLOCKSIZE 9193a3fa19SJohn W. De Boskeyspecification from the environment. 923a97f8afSWarren Block.It Fl h 93b93ce3b7SSimon L. B. Nielsen.Dq Human-readable 94b93ce3b7SSimon L. B. Nielsenoutput. 9571cfc678SGreg LeheyUse unit suffixes: Byte, Kibibyte, Mebibyte, Gibibyte, Tebibyte and 9671cfc678SGreg LeheyPebibyte (based on powers of 1024) in order to reduce the number of 9771cfc678SGreg Leheydigits to four or fewer. 98d0bc27e4SKyle Evans.It Fl H , Fl Fl si 99ad3d2e7eSFernando ApesteguíaSame as 100ad3d2e7eSFernando Apesteguía.Fl h 101ad3d2e7eSFernando Apesteguíabut based on powers of 1000. 1024b88c807SRodney W. Grimes.It Fl i 10371cfc678SGreg LeheyInclude statistics on the number of free and used inodes. 10471cfc678SGreg LeheyIn conjunction with the 10571cfc678SGreg Lehey.Fl h 10671cfc678SGreg Leheyor 10771cfc678SGreg Lehey.Fl H 10871cfc678SGreg Leheyoptions, the number of inodes is scaled by powers of 1000. 1092eee44bdSBaptiste DaroussinIn case the filesystem has no inodes then 1102eee44bdSBaptiste Daroussin.Sq - 1112eee44bdSBaptiste Daroussinis displayed instead of the usage percentage. 1127f0eabfdSGarrett Wollman.It Fl k 11371cfc678SGreg LeheyUse 1024 byte (1 Kibibyte) blocks rather than the default. 114019e4a53SGreg LeheyThis overrides the 115019e4a53SGreg Lehey.Fl P 11671cfc678SGreg Leheyoption and any 11771cfc678SGreg Lehey.Ev BLOCKSIZE 11871cfc678SGreg Leheyspecification from the environment. 119a25695c3SJim Pirzyk.It Fl l 120*304f52adSChia-Jung ChangSelect a locally-mounted file system for display. 121f0fd4a32SStefan EßerIf used in combination with the 122f0fd4a32SStefan Eßer.Fl t Ar type 123e3d3e1ffSPin-Yi Kuooption, file system types will be added or excluded according to the 124f0fd4a32SStefan Eßerparameters of that option. 125dd6d33e8SMichael Haro.It Fl m 12671cfc678SGreg LeheyUse 1048576 byte (1 Mebibyte) blocks rather than the default. 12771cfc678SGreg LeheyThis overrides any 128dd6d33e8SMichael Haro.Ev BLOCKSIZE 129dd6d33e8SMichael Harospecification from the environment. 1304b88c807SRodney W. Grimes.It Fl n 1314b88c807SRodney W. GrimesPrint out the previously obtained statistics from the file systems. 1324b88c807SRodney W. GrimesThis option should be used if it is possible that one or more 1334b88c807SRodney W. Grimesfile systems are in a state such that they will not be able to provide 1344b88c807SRodney W. Grimesstatistics without a long delay. 1354b88c807SRodney W. GrimesWhen this option is specified, 136d072138aSPhilippe Charnier.Nm 1374b88c807SRodney W. Grimeswill not request new statistics from the file systems, but will respond 1384b88c807SRodney W. Grimeswith the possibly stale statistics that were previously obtained. 139dd6d33e8SMichael Haro.It Fl P 14071cfc678SGreg LeheyExplicitly use 512 byte blocks, overriding any 141dd6d33e8SMichael Haro.Ev BLOCKSIZE 142dd6d33e8SMichael Harospecification from the environment. 14371cfc678SGreg LeheyThis is the same as the 14471cfc678SGreg Lehey.Fl b 14571cfc678SGreg Leheyoption. 146019e4a53SGreg LeheyThe 147019e4a53SGreg Lehey.Fl k 148019e4a53SGreg Leheyoption overrides this option. 149f0fd4a32SStefan Eßer.It Fl t Ar type 150f0fd4a32SStefan EßerSelect file systems to display. 151611d1296SBruce EvansMore than one type may be specified in a comma separated list. 152611d1296SBruce EvansThe list of file system types can be prefixed with 153611d1296SBruce Evans.Dq no 154611d1296SBruce Evansto specify the file system types for which action should 155611d1296SBruce Evans.Em not 156611d1296SBruce Evansbe taken. 157f0fd4a32SStefan EßerIf used in combination with the 158f0fd4a32SStefan Eßer.Fl l 159f0fd4a32SStefan Eßeroption, the parameters of this option will modify the list of 160f0fd4a32SStefan Eßerlocally-mounted file systems selected by the 161f0fd4a32SStefan Eßer.Fl l 162f0fd4a32SStefan Eßeroption. 163611d1296SBruce EvansFor example, the 164d072138aSPhilippe Charnier.Nm 165611d1296SBruce Evanscommand: 166611d1296SBruce Evans.Bd -literal -offset indent 1670b381bf1SRuslan Ermilovdf -t nonfs,nullfs 168611d1296SBruce Evans.Ed 169611d1296SBruce Evans.Pp 170ad3d2e7eSFernando Apesteguíalists all file systems except those of type NFS and NULLFS. 171611d1296SBruce EvansThe 172b84897d1SSheldon Hearn.Xr lsvfs 1 173611d1296SBruce Evanscommand can be used to find out the types of file systems 174b84897d1SSheldon Hearnthat are available on the system. 175b56ca465SPawel Jakub Dawidek.It Fl T 176b56ca465SPawel Jakub DawidekInclude file system type. 177019e4a53SGreg Lehey.It Fl , 178019e4a53SGreg Lehey(Comma) Print sizes grouped and separated by thousands using the 179019e4a53SGreg Leheynon-monetary separator returned by 180019e4a53SGreg Lehey.Xr localeconv 3 , 181019e4a53SGreg Leheytypically a comma or period. 182019e4a53SGreg LeheyIf no locale is set, or the locale does not have a non-monetary separator, this 183019e4a53SGreg Leheyoption has no effect. 1844b88c807SRodney W. Grimes.El 18584717b42SPoul-Henning Kamp.Sh ENVIRONMENT 1864b88c807SRodney W. Grimes.Bl -tag -width BLOCKSIZE 1874b88c807SRodney W. Grimes.It Ev BLOCKSIZE 18871cfc678SGreg LeheySpecifies the units in which to report block counts. 18971cfc678SGreg LeheyThis uses 19071cfc678SGreg Lehey.Xr getbsize 3 , 19171cfc678SGreg Leheywhich allows units of bytes or numbers scaled with the letters 19271cfc678SGreg Lehey.Em k 19371cfc678SGreg Lehey(for multiples of 1024 bytes), 19471cfc678SGreg Lehey.Em m 19571cfc678SGreg Lehey(for multiples of 1048576 bytes) or 19671cfc678SGreg Lehey.Em g 19771cfc678SGreg Lehey(for gibibytes). 19871cfc678SGreg LeheyThe allowed range is 512 bytes to 1 GB. 19971cfc678SGreg LeheyIf the value is outside, it will be set to the appropriate limit. 2004b88c807SRodney W. Grimes.El 201ad3d2e7eSFernando Apesteguía.Sh EXAMPLES 202ad3d2e7eSFernando ApesteguíaShow human readable free disk space for all mount points including file system 203ad3d2e7eSFernando Apesteguíatype: 204ad3d2e7eSFernando Apesteguía.Bd -literal -offset indent 205ad3d2e7eSFernando Apesteguía$ df -ahT 206ad3d2e7eSFernando ApesteguíaFilesystem Type Size Used Avail Capacity Mounted on 207ad3d2e7eSFernando Apesteguía/dev/ada1p2 ufs 213G 152G 44G 78% / 208ad3d2e7eSFernando Apesteguíadevfs devfs 1.0K 1.0K 0B 100% /dev 209ad3d2e7eSFernando Apesteguía/dev/ada0p1 ufs 1.8T 168G 1.5T 10% /data 210ad3d2e7eSFernando Apesteguíalinsysfs linsysfs 4.0K 4.0K 0B 100% /compat/linux/sys 211ad3d2e7eSFernando Apesteguía/dev/da0 msdosfs 7.6G 424M 7.2G 5% /mnt/usb 212ad3d2e7eSFernando Apesteguía.Ed 213ad3d2e7eSFernando Apesteguía.Pp 214ad3d2e7eSFernando ApesteguíaShow previously collected data including inode statistics except for devfs or 215ad3d2e7eSFernando Apesteguíalinsysfs file systems. 216ad3d2e7eSFernando ApesteguíaNote that the 217ad3d2e7eSFernando Apesteguía.Dq no 218ad3d2e7eSFernando Apesteguíaprefix affects all the file systems in the list and the 219ad3d2e7eSFernando Apesteguía.Fl t 220ad3d2e7eSFernando Apesteguíaoption can be specified only once: 221ad3d2e7eSFernando Apesteguía.Bd -literal -offset indent 222ad3d2e7eSFernando Apesteguía$ df -i -n -t nodevfs,linsysfs 223ad3d2e7eSFernando ApesteguíaFilesystem 1K-blocks Used Avail Capacity iused ifree %iused 224ad3d2e7eSFernando ApesteguíaMounted on 225ad3d2e7eSFernando Apesteguía/dev/ada1p2 223235736 159618992 45757888 78% 1657590 27234568 6% / 226ad3d2e7eSFernando Apesteguía/dev/ada0p1 1892163184 176319420 1564470712 10% 1319710 243300576 1% 227ad3d2e7eSFernando Apesteguía/data 228ad3d2e7eSFernando Apesteguía/dev/da0 7989888 433664 7556224 5% 0 0 100% 229ad3d2e7eSFernando Apesteguía/mnt/usb 230ad3d2e7eSFernando Apesteguía.Ed 231ad3d2e7eSFernando Apesteguía.Pp 232ad3d2e7eSFernando ApesteguíaShow human readable information for the file system containing the file 233a0e85d0eSMateusz Piotrowski.Pa /etc/rc.conf : 234ad3d2e7eSFernando Apesteguía.Bd -literal -offset indent 235ad3d2e7eSFernando Apesteguía$ df -h /etc/rc.conf 236ad3d2e7eSFernando ApesteguíaFilesystem Size Used Avail Capacity Mounted on 237ad3d2e7eSFernando Apesteguía/dev/ada1p2 213G 152G 44G 78% / 238ad3d2e7eSFernando Apesteguía.Ed 239ad3d2e7eSFernando Apesteguía.Pp 240ad3d2e7eSFernando ApesteguíaSame as above but specifying some file system: 241ad3d2e7eSFernando Apesteguía.Bd -literal -offset indent 242ad3d2e7eSFernando Apesteguía$ df -h /dev/ada1p2 243ad3d2e7eSFernando ApesteguíaFilesystem Size Used Avail Capacity Mounted on 244ad3d2e7eSFernando Apesteguía/dev/ada1p2 213G 152G 44G 78% / 245ad3d2e7eSFernando Apesteguía.Ed 246c33db74bSStefan Eßer.Sh NOTES 247c33db74bSStefan EßerFor non-Unix file systems, the reported values of used and free inodes 248c33db74bSStefan Eßermay have a different meaning than that of used and available files and 249c33db74bSStefan Eßerdirectories. 250c33db74bSStefan EßerAn example is msdosfs, which in the case of FAT12 or FAT16 file systems 251c33db74bSStefan Eßerreports the number of available and free root directory entries instead 252c33db74bSStefan Eßerof inodes 253c33db74bSStefan Eßer.Po 254c33db74bSStefan Eßerwhere 1 to 21 such directory entries are required to store 255c33db74bSStefan Eßereach file or directory name or disk label 256c33db74bSStefan Eßer.Pc . 2574b88c807SRodney W. Grimes.Sh SEE ALSO 258b84897d1SSheldon Hearn.Xr lsvfs 1 , 2594b88c807SRodney W. Grimes.Xr quota 1 , 2604b88c807SRodney W. Grimes.Xr fstatfs 2 , 2614b88c807SRodney W. Grimes.Xr getfsstat 2 , 262af202156SWolfram Schneider.Xr statfs 2 , 26371cfc678SGreg Lehey.Xr getbsize 3 , 2644b88c807SRodney W. Grimes.Xr getmntinfo 3 , 2656fea8dc8SMarcel Moolenaar.Xr libxo 3 , 266019e4a53SGreg Lehey.Xr localeconv 3 , 2676fea8dc8SMarcel Moolenaar.Xr xo_parse_args 3 , 2684b88c807SRodney W. Grimes.Xr fstab 5 , 2694b88c807SRodney W. Grimes.Xr mount 8 , 270c9e571feSGreg Lehey.Xr pstat 8 , 271c9e571feSGreg Lehey.Xr quot 8 , 272b5a8b741SChristian Brueffer.Xr swapinfo 8 273019e4a53SGreg Lehey.Sh STANDARDS 274019e4a53SGreg LeheyWith the exception of most options, 275019e4a53SGreg Leheythe 276019e4a53SGreg Lehey.Nm 277019e4a53SGreg Leheyutility conforms to 278019e4a53SGreg Lehey.St -p1003.1-2004 , 279019e4a53SGreg Leheywhich defines only the 280019e4a53SGreg Lehey.Fl k , P 281019e4a53SGreg Leheyand 282019e4a53SGreg Lehey.Fl t 283019e4a53SGreg Leheyoptions. 2844b88c807SRodney W. Grimes.Sh HISTORY 2854b88c807SRodney W. GrimesA 286d072138aSPhilippe Charnier.Nm 2874b88c807SRodney W. Grimescommand appeared in 288b8923d4cSWolfram Schneider.At v1 . 2896fca4c7cSRuslan Ermilov.Sh BUGS 2906fca4c7cSRuslan ErmilovThe 2916fca4c7cSRuslan Ermilov.Fl n 2926fca4c7cSRuslan Ermilovflag is ignored if a file or file system is specified. 2936fca4c7cSRuslan ErmilovAlso, if a mount 2946fca4c7cSRuslan Ermilovpoint is not accessible by the user, it is possible that the file system 2956fca4c7cSRuslan Ermilovinformation could be stale. 29671cfc678SGreg Lehey.Pp 29771cfc678SGreg LeheyThe 29871cfc678SGreg Lehey.Fl b 29971cfc678SGreg Leheyand 30071cfc678SGreg Lehey.Fl P 30171cfc678SGreg Leheyoptions are identical. 30271cfc678SGreg LeheyThe former comes from the BSD tradition, and the latter is required 30371cfc678SGreg Leheyfor 30471cfc678SGreg Lehey.St -p1003.1-2004 30571cfc678SGreg Leheyconformity. 306