[BACK]Return to du.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / du

Annotation of src/usr.bin/du/du.1, Revision 1.38

1.38    ! schwarze    1: .\"    $OpenBSD: du.1,v 1.37 2020/01/30 17:54:30 schwarze Exp $
1.4       millert     2: .\"    $NetBSD: du.1,v 1.6 1996/10/18 07:20:31 thorpej Exp $
1.1       deraadt     3: .\"
                      4: .\" Copyright (c) 1990, 1993
                      5: .\"    The Regents of the University of California.  All rights reserved.
                      6: .\"
                      7: .\" Redistribution and use in source and binary forms, with or without
                      8: .\" modification, are permitted provided that the following conditions
                      9: .\" are met:
                     10: .\" 1. Redistributions of source code must retain the above copyright
                     11: .\"    notice, this list of conditions and the following disclaimer.
                     12: .\" 2. Redistributions in binary form must reproduce the above copyright
                     13: .\"    notice, this list of conditions and the following disclaimer in the
                     14: .\"    documentation and/or other materials provided with the distribution.
1.18      millert    15: .\" 3. Neither the name of the University nor the names of its contributors
1.1       deraadt    16: .\"    may be used to endorse or promote products derived from this software
                     17: .\"    without specific prior written permission.
                     18: .\"
                     19: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     20: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     21: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     22: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     23: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     24: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     25: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     26: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     27: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     28: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     29: .\" SUCH DAMAGE.
                     30: .\"
                     31: .\"    @(#)du.1        8.2 (Berkeley) 4/1/94
                     32: .\"
1.37      schwarze   33: .Dd $Mdocdate: January 30 2020 $
1.1       deraadt    34: .Dt DU 1
                     35: .Os
                     36: .Sh NAME
                     37: .Nm du
                     38: .Nd display disk usage statistics
                     39: .Sh SYNOPSIS
                     40: .Nm du
1.33      schwarze   41: .Op Fl achkrsx
1.34      jmc        42: .Op Fl H | L | P
1.32      schwarze   43: .Op Fl d Ar depth
1.26      sobrado    44: .Op Ar
1.1       deraadt    45: .Sh DESCRIPTION
                     46: The
1.10      aaron      47: .Nm
1.8       aaron      48: utility displays the file system block usage for each
                     49: .Ar file
                     50: argument
1.1       deraadt    51: and for each directory in the file hierarchy rooted in each directory
1.12      aaron      52: argument.
                     53: Note that the system block usage is usually greater than
1.7       millert    54: the actual size of the file.
1.1       deraadt    55: If no file is specified, the block usage of the hierarchy rooted in
                     56: the current directory is displayed.
                     57: .Pp
                     58: The options are as follows:
                     59: .Bl -tag -width Ds
1.19      jmc        60: .It Fl a
1.32      schwarze   61: Display entries for files in addition to entries for directories.
1.19      jmc        62: .It Fl c
                     63: Display the grand total after all the arguments have been processed.
1.32      schwarze   64: .It Fl d Ar depth
                     65: Do not display entries for files and directories more than
                     66: .Ar depth
                     67: levels deep;
                     68: .Fl d Cm 0
                     69: has the same effect as
                     70: .Fl s .
                     71: Overrides earlier
                     72: .Fl d
                     73: and
                     74: .Fl s
                     75: options.
1.1       deraadt    76: .It Fl H
                     77: Symbolic links on the command line are followed.
1.29      jmc        78: Symbolic links encountered in the tree traversal are not followed.
1.19      jmc        79: .It Fl h
1.25      jmc        80: "Human-readable" output.
                     81: Use unit suffixes: Byte, Kilobyte, Megabyte,
                     82: Gigabyte, Terabyte, Petabyte, Exabyte in order to reduce the number of
                     83: digits to four or less.
1.1       deraadt    84: .It Fl k
1.25      jmc        85: By default, all sizes are reported in 512-byte block counts.
                     86: The
1.1       deraadt    87: .Fl k
1.25      jmc        88: option causes the numbers to be reported in kilobyte counts.
1.19      jmc        89: .It Fl L
                     90: All symbolic links are followed.
                     91: .It Fl P
                     92: No symbolic links are followed.
1.5       deraadt    93: .It Fl r
                     94: Generate messages about directories that cannot be read, files
1.12      aaron      95: that cannot be opened, and so on.
1.23      jmc        96: This is the default.
1.19      jmc        97: .It Fl s
1.32      schwarze   98: Display only the total for each of the specified files and directories.
                     99: Overrides earlier
                    100: .Fl d
                    101: options.
1.1       deraadt   102: .It Fl x
1.11      aaron     103: File system mount points are not traversed.
1.1       deraadt   104: .El
1.25      jmc       105: .Pp
                    106: It is not an error to specify more than one of
                    107: the mutually exclusive options
                    108: .Fl h
                    109: and
                    110: .Fl k .
                    111: Where more than one of these options is specified,
                    112: the last option given overrides the others.
1.1       deraadt   113: .Pp
1.10      aaron     114: .Nm
1.1       deraadt   115: counts the storage used by symbolic links and not the files they
                    116: reference unless the
                    117: .Fl H
1.9       aaron     118: or
                    119: .Fl L
                    120: option is specified.
1.1       deraadt   121: If either the
                    122: .Fl H
                    123: or
                    124: .Fl L
                    125: options are specified, storage used by any symbolic links which are
                    126: followed is not counted or displayed.
                    127: The
                    128: .Fl H ,
1.12      aaron     129: .Fl L ,
1.1       deraadt   130: and
                    131: .Fl P
                    132: options override each other and the command's actions are determined
                    133: by the last one specified.
                    134: .Pp
                    135: Files having multiple hard links are counted (and displayed) a single
                    136: time per
1.10      aaron     137: .Nm
1.1       deraadt   138: execution.
1.6       deraadt   139: .Sh ENVIRONMENT
1.1       deraadt   140: .Bl -tag -width BLOCKSIZE
                    141: .It Ev BLOCKSIZE
1.11      aaron     142: Block counts will be displayed in units of this size block, unless the
1.1       deraadt   143: .Fl k
1.16      pjanzen   144: or
                    145: .Fl h
                    146: option is specified.
1.1       deraadt   147: .El
1.28      jmc       148: .Sh EXIT STATUS
                    149: .Ex -std du
1.36      schwarze  150: .Sh EXAMPLES
                    151: Display a summary of files and folders in the current directory,
                    152: sorted by size:
                    153: .Pp
1.38    ! schwarze  154: .Dl $ du -had 1 | sort -h
1.1       deraadt   155: .Sh SEE ALSO
                    156: .Xr df 1 ,
1.35      deraadt   157: .Xr fts_open 3 ,
1.1       deraadt   158: .Xr symlink 7 ,
                    159: .Xr quot 8
1.20      jmc       160: .Sh STANDARDS
                    161: The
                    162: .Nm
                    163: utility is compliant with the
1.24      jmc       164: .St -p1003.1-2008
1.20      jmc       165: specification.
                    166: .Pp
                    167: The flags
1.32      schwarze  168: .Op Fl cdhP ,
1.30      jmc       169: as well as the
                    170: .Ev BLOCKSIZE
                    171: environment variable,
1.20      jmc       172: are extensions to that specification.
1.23      jmc       173: .Pp
                    174: The flag
                    175: .Op Fl r
1.31      schwarze  176: is accepted but ignored, for compatibility with systems implementing
                    177: the obsolete
                    178: .St -xcu5
                    179: standard.
1.1       deraadt   180: .Sh HISTORY
1.32      schwarze  181: The
1.10      aaron     182: .Nm
1.32      schwarze  183: utility and its
                    184: .Fl a
                    185: and
                    186: .Fl s
                    187: options first appeared in
                    188: .At v1 .
                    189: .Pp
                    190: The
                    191: .Fl r
                    192: option first appeared in
                    193: .At III
                    194: and is available since
                    195: .Ox 2.3 .
                    196: The
                    197: .Fl k
                    198: and
                    199: .Fl x
                    200: options first appeared in
                    201: .Bx 4.3 Reno
                    202: and
                    203: .Fl H
                    204: in
                    205: .Bx 4.4 .
                    206: The
                    207: .Fl c
                    208: and
                    209: .Fl L
                    210: options first appeared in the GNU fileutils;
                    211: .Fl L
                    212: and
                    213: .Fl P
                    214: are available since
                    215: .Bx 4.4 Lite1 ,
                    216: .Fl c
                    217: since
                    218: .Ox 2.1 .
                    219: The
                    220: .Fl d
                    221: option first appeared in
                    222: .Fx 2.2
                    223: and is available since
                    224: .Ox 5.7 ,
                    225: .Fl h
                    226: first appeared in
                    227: .Fx 4.0
                    228: and is available since
                    229: .Ox 2.9 .
1.31      schwarze  230: .Sh AUTHORS
                    231: .An -nosplit
                    232: This version of
                    233: .Nm
                    234: was written by
                    235: .An Chris Newcomb
                    236: for
                    237: .Bx 4.3 Reno
                    238: in 1989 and incorporates later contributions from
                    239: .An Elan Amir ,
                    240: .An Keith Bostic ,
                    241: .An Luke Mewburn ,
                    242: .An Matt Bing ,
                    243: and
                    244: .An Can Erkin Acar Aq Mt canacar@openbsd.org .