logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

df.1p (9804B)


  1. '\" et
  2. .TH DF "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. df
  12. \(em report free disk space
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. df \fB[\fR-k\fB] [\fR-P|-t\fB] [\fIfile\fR...\fB]\fR
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR df
  21. utility shall write the amount of available space
  22. and file slots
  23. for file systems on which the invoking user has appropriate read
  24. access. File systems shall be specified by the
  25. .IR file
  26. operands; when none are specified, information shall be written for all
  27. file systems. The format of the default output from
  28. .IR df
  29. is unspecified, but all space figures are reported in 512-byte units,
  30. unless the
  31. .BR \-k
  32. option is specified. This output shall contain at least the file system
  33. names, amount of available space on each of these file systems,
  34. and, if no options other than
  35. .BR \-t
  36. are specified, the number of free file slots, or
  37. .IR inode s,
  38. available; when
  39. .BR \-t
  40. is specified, the output shall contain the total allocated space as well.
  41. .SH OPTIONS
  42. The
  43. .IR df
  44. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  45. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  46. .P
  47. The following options shall be supported:
  48. .IP "\fB\-k\fP" 10
  49. Use 1\|024-byte units, instead of the default 512-byte units, when
  50. writing space figures.
  51. .IP "\fB\-P\fP" 10
  52. Produce output in the format described in the STDOUT section.
  53. .IP "\fB\-t\fP" 10
  54. Include total allocated-space figures in the output.
  55. .SH OPERANDS
  56. The following operand shall be supported:
  57. .IP "\fIfile\fR" 10
  58. A pathname of a file within the hierarchy of the desired file system.
  59. If a file other than a FIFO, a regular file, a directory,
  60. or a special file representing the device containing the file system
  61. (for example,
  62. .BR /dev/dsk/0s1 )
  63. is specified, the results are unspecified. If the
  64. .IR file
  65. operand names a file other than a special file containing a file
  66. system,
  67. .IR df
  68. shall write the amount of free space in the file system containing the
  69. specified
  70. .IR file
  71. operand.
  72. Otherwise,
  73. .IR df
  74. shall write the amount of free space in that file system.
  75. .SH STDIN
  76. Not used.
  77. .SH "INPUT FILES"
  78. None.
  79. .SH "ENVIRONMENT VARIABLES"
  80. The following environment variables shall affect the execution of
  81. .IR df :
  82. .IP "\fILANG\fP" 10
  83. Provide a default value for the internationalization variables that are
  84. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  85. .IR "Section 8.2" ", " "Internationalization Variables"
  86. for the precedence of internationalization variables used to determine
  87. the values of locale categories.)
  88. .IP "\fILC_ALL\fP" 10
  89. If set to a non-empty string value, override the values of all the
  90. other internationalization variables.
  91. .IP "\fILC_CTYPE\fP" 10
  92. Determine the locale for the interpretation of sequences of bytes of
  93. text data as characters (for example, single-byte as opposed to
  94. multi-byte characters in arguments).
  95. .IP "\fILC_MESSAGES\fP" 10
  96. .br
  97. Determine the locale that should be used to affect the format and
  98. contents of diagnostic messages written to standard error and
  99. informative messages written to standard output.
  100. .IP "\fINLSPATH\fP" 10
  101. Determine the location of message catalogs for the processing of
  102. .IR LC_MESSAGES .
  103. .SH "ASYNCHRONOUS EVENTS"
  104. Default.
  105. .SH STDOUT
  106. When both the
  107. .BR \-k
  108. and
  109. .BR \-P
  110. options are specified, the following header line shall be written (in
  111. the POSIX locale):
  112. .sp
  113. .RS 4
  114. .nf
  115. "Filesystem 1024-blocks Used Available Capacity Mounted on\en"
  116. .fi
  117. .P
  118. .RE
  119. .P
  120. When the
  121. .BR \-P
  122. option is specified without the
  123. .BR \-k
  124. option, the following header line shall be written (in the POSIX
  125. locale):
  126. .sp
  127. .RS 4
  128. .nf
  129. "Filesystem 512-blocks Used Available Capacity Mounted on\en"
  130. .fi
  131. .P
  132. .RE
  133. .P
  134. The implementation may adjust the spacing of the header line and the
  135. individual data lines so that the information is presented in orderly
  136. columns.
  137. .P
  138. The remaining output with
  139. .BR \-P
  140. shall consist of one line of information for each specified
  141. file system. These lines shall be formatted as follows:
  142. .sp
  143. .RS 4
  144. .nf
  145. "%s %d %d %d %d%% %s\en", <\fIfile system name\fR>, <\fItotal space\fR>,
  146. <\fIspace used\fR>, <\fIspace free\fR>, <\fIpercentage used\fR>,
  147. <\fIfile system root\fR>
  148. .fi
  149. .P
  150. .RE
  151. .P
  152. In the following list, all quantities expressed in 512-byte units
  153. (1\|024-byte when
  154. .BR \-k
  155. is specified) shall be rounded up to the next higher unit. The fields
  156. are:
  157. .IP "<\fIfile\ system\ name\fP>" 10
  158. .br
  159. The name of the file system, in an implementation-defined format.
  160. .IP "<\fItotal\ space\fP>" 10
  161. The total size of the file system in 512-byte units. The exact meaning
  162. of this figure is implementation-defined, but should include
  163. <\fIspace\ used\fP>, <\fIspace\ free\fP>, plus any space reserved by
  164. the system not normally available to a user.
  165. .IP "<\fIspace\ used\fP>" 10
  166. The total amount of space allocated to existing files in the
  167. file system, in 512-byte units.
  168. .IP "<\fIspace\ free\fP>" 10
  169. The total amount of space available within the file system for the
  170. creation of new files by unprivileged users, in 512-byte units. When
  171. this figure is less than or equal to zero, it shall not be possible to
  172. create any new files on the file system without first deleting others,
  173. unless the process has appropriate privileges. The figure written may
  174. be less than zero.
  175. .IP "<\fIpercentage\ used\fP>" 10
  176. .br
  177. The percentage of the normally available space that is currently
  178. allocated to all files on the file system. This shall be calculated
  179. using the fraction:
  180. .RS 10
  181. .sp
  182. .RS 4
  183. .nf
  184. <\fIspace used\fR>/( <\fIspace used\fR>+ <\fIspace free\fR>)
  185. .fi
  186. .P
  187. .RE
  188. .P
  189. expressed as a percentage. This percentage may be greater than 100 if
  190. <\fIspace\ free\fP> is less than zero. The percentage value shall be
  191. expressed as a positive integer, with any fractional result causing it
  192. to be rounded to the next highest integer.
  193. .RE
  194. .IP "<\fIfile\ system\ root\fP>" 10
  195. .br
  196. The directory below which the file system hierarchy appears.
  197. .P
  198. The output format is unspecified when
  199. .BR \-t
  200. is used.
  201. .SH STDERR
  202. The standard error shall be used only for diagnostic messages.
  203. .SH "OUTPUT FILES"
  204. None.
  205. .SH "EXTENDED DESCRIPTION"
  206. None.
  207. .SH "EXIT STATUS"
  208. The following exit values shall be returned:
  209. .IP "\00" 6
  210. Successful completion.
  211. .IP >0 6
  212. An error occurred.
  213. .SH "CONSEQUENCES OF ERRORS"
  214. Default.
  215. .LP
  216. .IR "The following sections are informative."
  217. .SH "APPLICATION USAGE"
  218. On most systems, the ``name of the file system, in an
  219. implementation-defined format'' is the special file on which the
  220. file system is mounted.
  221. .P
  222. On large file systems, the calculation specified for percentage used
  223. can create huge rounding errors.
  224. .SH EXAMPLES
  225. .IP " 1." 4
  226. The following example writes portable information about the
  227. .BR /usr
  228. file system:
  229. .RS 4
  230. .sp
  231. .RS 4
  232. .nf
  233. df -P /usr
  234. .fi
  235. .P
  236. .RE
  237. .RE
  238. .IP " 2." 4
  239. Assuming that
  240. .BR /usr/src
  241. is part of the
  242. .BR /usr
  243. file system, the following produces the same output as the previous
  244. example:
  245. .RS 4
  246. .sp
  247. .RS 4
  248. .nf
  249. df -P /usr/src
  250. .fi
  251. .P
  252. .RE
  253. .RE
  254. .SH RATIONALE
  255. The behavior of
  256. .IR df
  257. with the
  258. .BR \-P
  259. option is the default action of the 4.2 BSD
  260. .IR df
  261. utility. The uppercase
  262. .BR \-P
  263. was selected to avoid collision with a known industry extension using
  264. .BR \-p .
  265. .P
  266. Historical
  267. .IR df
  268. implementations vary considerably in their default output. It was
  269. therefore necessary to describe the default output in a loose manner to
  270. accommodate all known historical implementations and to add a portable
  271. option (\c
  272. .BR \-P )
  273. to provide information in a portable format.
  274. .P
  275. The use of 512-byte units is historical practice and maintains
  276. compatibility with
  277. .IR ls
  278. and other utilities in this volume of POSIX.1\(hy2017. This does not mandate that the
  279. file system itself be based on 512-byte blocks. The
  280. .BR \-k
  281. option was added as a compromise measure. It was agreed by the standard
  282. developers that 512 bytes was the best default unit because of its
  283. complete historical consistency on System V (\fIversus\fP the mixed
  284. 512/1\|024-byte usage on BSD systems), and that a
  285. .BR \-k
  286. option to switch to 1\|024-byte units was a good compromise. Users who
  287. prefer the more logical 1\|024-byte quantity can easily alias
  288. .IR df
  289. to
  290. .IR df
  291. .BR \-k
  292. without breaking many historical scripts relying on the 512-byte
  293. units.
  294. .P
  295. It was suggested that
  296. .IR df
  297. and the various related utilities be modified to access a
  298. .IR BLOCKSIZE
  299. environment variable to achieve consistency and user acceptance. Since
  300. this is not historical practice on any system, it is left as a possible
  301. area for system extensions and will be re-evaluated in a future version
  302. if it is widely implemented.
  303. .SH "FUTURE DIRECTIONS"
  304. None.
  305. .SH "SEE ALSO"
  306. .IR "\fIfind\fR\^"
  307. .P
  308. The Base Definitions volume of POSIX.1\(hy2017,
  309. .IR "Chapter 8" ", " "Environment Variables",
  310. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  311. .\"
  312. .SH COPYRIGHT
  313. Portions of this text are reprinted and reproduced in electronic form
  314. from IEEE Std 1003.1-2017, Standard for Information Technology
  315. -- Portable Operating System Interface (POSIX), The Open Group Base
  316. Specifications Issue 7, 2018 Edition,
  317. Copyright (C) 2018 by the Institute of
  318. Electrical and Electronics Engineers, Inc and The Open Group.
  319. In the event of any discrepancy between this version and the original IEEE and
  320. The Open Group Standard, the original IEEE and The Open Group Standard
  321. is the referee document. The original Standard can be obtained online at
  322. http://www.opengroup.org/unix/online.html .
  323. .PP
  324. Any typographical or formatting errors that appear
  325. in this page are most likely
  326. to have been introduced during the conversion of the source files to
  327. man page format. To report such errors, see
  328. https://www.kernel.org/doc/man-pages/reporting_bugs.html .