man pages section 1M: Maintenance Commands
검색에만이 책은
PDF로 이 문서 다운로드 (1996 KB)

du(1M)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | OUTPUT | USAGE | ENVIRONMENT VARIABLES | EXIT STATUS | ATTRIBUTES | SUMMARY OF TRUSTED SOLARIS CHANGES | SEE ALSO | NOTES

NAME

    du- Summarize disk usage

SYNOPSIS

    /usr/bin/du [-adkLr] [-s| -o] [-M] [file...]
    /usr/xpg4/bin/du [-a| -s] [-krx] [file...]

DESCRIPTION

    The du utility writes to standard output the size of the file space allocated to, and the size of the file space allocated to each subdirectory of, the file hierarchy rooted in each of the specified files. The size of the file space allocated to a file of type directory is defined as the sum total of space allocated to all files in the file hierarchy rooted in the directory plus the space allocated to the directory itself.

    Files with multiple links will be counted and written for only one entry. The directory entry that is selected in the report is unspecified. By default, file sizes are written in 512-byte units, rounded up to the next 512-byte unit.

    /usr/xpg4/bin/du

      When du cannot obtain file attributes or read directories (see stat(2)), it will report an error condition and the final exit status will be affected.

OPTIONS

    The following options are supported for /usr/bin/du and /usr/xpg4/bin/du:

    -a

    In addition to the default output, report the size of each file not of type directory in the file hierarchy rooted in the specified file. Regardless of the presence of the -a option, non-directories given as file operands will always be listed.

    -k

    Write the files sizes in units of 1024 bytes, rather than the default 512-byte units.

    -s

    Instead of the default output, report only the total sum for each of the specified files.

    /usr/bin/du

      The following options are supported for /usr/bin/du only:

      -d

      Do not cross filesystem boundaries. For example, du -d / reports usage only on the root partition.

      -L

      Process symbolic links by using the file or directory which the symbolic link references, rather than the link itself.

      -o

      Do not add child directories' usage to a parent's total. Without this option, the usage listed for a particular directory is the space taken by the files in that directory, as well as the files in all directories beneath it. This option does nothing if -s is used.

      -r

      Generate messages about directories that cannot be read, files that cannot be opened, and so forth, rather than being silent (the default).

      -M

      Process all accessible single-level directories while descending multilevel directories.

    /usr/xpg4/bin/du

      The following options are supported for /usr/xpg4/bin/du only:

      -r

      By default, generate messages about directories that cannot be read, files that cannot be opened, and so forth.

      -x

      When evaluating file sizes, evaluate only those files that have the same device as the file specified by the file operand.

OPERANDS

    The following operand is supported:

    file

    The path name of a file whose size is to be written. If file is not specified, the current directory is used.

OUTPUT

    The output from du consists of the amount of the space allocated to a file and the name of the file.

USAGE

    See largefile(5) for the description of the behavior of du when encountering files greater than or equal to 2 Gbyte ( 231 bytes).

ENVIRONMENT VARIABLES

    See environ(5) for descriptions of the following environment variables that affect the execution of du: LC_CTYPE, LC_MESSAGES, and NLSPATH.

EXIT STATUS

    The following exit values are returned:

    0

    Successful completion.

    >0

    An error occurred.

ATTRIBUTES

    See attributes(5) for descriptions of the following attributes:

    /usr/bin/du

      ATTRIBUTE TYPEATTRIBUTE VALUE
      AvailabilitySUNWcsu
      CSIenabled

    /usr/xpg4/bin/du

      ATTRIBUTE TYPEATTRIBUTE VALUE
      AvailabilitySUNWxcu4
      CSIenabled

SUMMARY OF TRUSTED SOLARIS CHANGES

    The -M option processes SLDs when descending multilevel directories.

SEE ALSO

NOTES

    A file with two or more links is counted only once. If, however, there are links between files in different directories where the directories are on separate branches of the file system hierarchy, du will count the excess files more than once.

    Files containing holes will result in an incorrect block count.

SunOS 5.8 Last Revised 2 Jun 1997

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | OUTPUT | USAGE | ENVIRONMENT VARIABLES | EXIT STATUS | ATTRIBUTES | SUMMARY OF TRUSTED SOLARIS CHANGES | SEE ALSO | NOTES