xref: /original-bsd/usr.bin/du/du.1 (revision e58c8952)
1.\" Copyright (c) 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"	@(#)du.1	8.2 (Berkeley) 04/01/94
7.\"
8.Dd
9.Dt DU 1
10.Os
11.Sh NAME
12.Nm du
13.Nd display disk usage statistics
14.Sh SYNOPSIS
15.Nm du
16.Op Fl H | Fl L | Fl P
17.Op Fl a | Fl s
18.Op Fl x
19.Op Ar file ...
20.Sh DESCRIPTION
21The
22.Nm du
23utility displays the file system block usage for each file argument
24and for each directory in the file hierarchy rooted in each directory
25argument.
26If no file is specified, the block usage of the hierarchy rooted in
27the current directory is displayed.
28The number of blocks are in the same units as that returned by the
29.Xr stat 2
30system call, i.e. 512-byte blocks.
31Partial numbers of blocks are rounded up.
32.Pp
33The options are as follows:
34.Bl -tag -width Ds
35.It Fl H
36Symbolic links on the command line are followed.
37(Symbolic links encountered in the tree traversal are not followed.)
38.It Fl L
39All symbolic links are followed.
40.It Fl P
41No symbolic links are followed.
42.It Fl a
43Display an entry for each file in the file hierarchy.
44.It Fl s
45Display only the grand total for the specified files.
46.It Fl x
47Filesystem mount points are not traversed.
48.El
49.Pp
50.Nm Du
51counts the storage used by symbolic links and not the files they
52reference unless the
53.Fl H
54or
55.Fl L
56option is specified.
57If either the
58.Fl H
59or
60.Fl L
61options are specified, storage used by any symbolic links which are
62followed is not counted or displayed.
63The
64.Fl H ,
65.Fl L
66and
67.Fl P
68options override each other and the command's actions are determined
69by the last one specified.
70.Pp
71Files having multiple hard links are counted (and displayed) a single
72time per
73.Nm du
74execution.
75.Sh ENVIRONMENTAL VARIABLES
76.Bl -tag -width BLOCKSIZE
77.It Ev BLOCKSIZE
78If the environmental variable
79.Ev BLOCKSIZE
80is set, the block counts will be displayed in units of that size block.
81.El
82.Sh SEE ALSO
83.Xr df 1 ,
84.Xr fts 3 ,
85.Xr symlink 7 ,
86.Xr quot 8
87.Sh HISTORY
88A
89.Nm du
90command appeared in
91.At v6 .
92