du 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. .TH DU 1
  2. .SH NAME
  3. du \- disk usage
  4. .SH SYNOPSIS
  5. .B du
  6. [
  7. .B -aefhnqstu
  8. ] [
  9. .B -b
  10. .I size
  11. ] [
  12. .B -p
  13. .I SI-prefix
  14. ] [
  15. .I file ...
  16. ]
  17. .SH DESCRIPTION
  18. .I Du
  19. gives the number of Kbytes allocated to data blocks
  20. of named
  21. .I files
  22. and, recursively, of files in named directories.
  23. It assumes storage is quantized in units of 1024 bytes (Kbytes) by default.
  24. Other values can be set by the
  25. .B -b
  26. option;
  27. .I size
  28. is the number of bytes, optionally suffixed
  29. .B k
  30. to specify multiplication by 1024.
  31. If
  32. .I file
  33. is missing,
  34. the current directory is used.
  35. The count for a directory includes the counts of the
  36. contained files and directories.
  37. .PP
  38. The
  39. .B -a
  40. option prints the number of blocks
  41. for every file in a directory.
  42. Normally counts are printed only for contained directories.
  43. .PP
  44. The
  45. .B -f
  46. option suppresses the printing of warning messages.
  47. .PP
  48. The
  49. .B -n
  50. option prints the size in bytes and the name of each file; it sets
  51. .BR -a .
  52. .PP
  53. The
  54. .B -t
  55. option prints, in the format of
  56. .B du
  57. .BR -n ,
  58. the modified time of
  59. each file rather than the size.
  60. If the options
  61. .B -tu
  62. are specified then the accessed time is printed.
  63. .PP
  64. The
  65. .B -q
  66. option prints, in the format of
  67. .B du
  68. .BR -n ,
  69. the QID path of
  70. each file rather than the size.
  71. .PP
  72. The
  73. .B -s
  74. option causes
  75. .I du
  76. to descend the hierarchy as always, but to print only a summary line
  77. for each
  78. .IR file .
  79. .PP
  80. The
  81. .B -e
  82. option causes
  83. .I du
  84. to print values (sizes, times or QID paths)
  85. in `scientific notation' via
  86. .IR print (2)'s
  87. .BR %g .
  88. .PP
  89. The
  90. .B -h
  91. option causes
  92. .I du
  93. to print values (sizes, times or QID paths)
  94. in scientific notation,
  95. scaled to less than 1024, and with a suitable SI prefix
  96. (e.g.,
  97. .L G
  98. for binary gigabytes).
  99. .PP
  100. The
  101. .B -p
  102. option causes
  103. .I du
  104. to print values (sizes, times or QID paths)
  105. in units of
  106. .IR SI-prefix .
  107. Case is ignored when looking up
  108. .IR SI-prefix .
  109. An empty
  110. .IR SI-prefix
  111. corresponds to a scale factor of 1 (e.g., print sizes in bytes).
  112. .\" .PP
  113. .\" The
  114. .\" .B -r
  115. .\" option causes
  116. .\" .I du
  117. .\" to read and discard every byte of every file encountered.
  118. .SH EXAMPLES
  119. Print the size of
  120. .L /tmp
  121. in fractional binary gigabytes:
  122. .IP
  123. .EX
  124. % du -sepg /tmp
  125. \&.6960154 /tmp
  126. .EE
  127. .LP
  128. Print the size of
  129. .L /tmp
  130. in bytes and in scientific notation:
  131. .IP
  132. .EX
  133. % du -sep '' /tmp
  134. 7.473408e+08 /tmp
  135. .EE
  136. .SH SOURCE
  137. .B /sys/src/cmd/du.c