du - reports disk space usage

Overview

du [options] [file...]

POSIX options: [-askx]

GNU options (shortest form):

[-abcDhHklLmsSxX] [--block-size=size] [--exclude=pattern] [--max-depth=n] [--help] [--version] [--]

description

Du reports the amount of disk space specified file has been used, including in the hierarchy to the specified file to the root directory account. Here 'disk space used' means space for the entire file hierarchy under the specified file is used.

In the case of not given parameter, du reports the current directory of the disk space used.

POSIX details

When the default output 512-byte counts, if given the option -k, 1024 places byte counts.

GNU details

(In the absence of the counts with the option to specify) the output counts of 1024 bytes, but not the case since the environment variable POSIXLY_CORRECT and follow the POSIX standard.

POSIX options

-a
Displays statistics for all of the files involved, not just Include subdirectories.
-k
1024 bytes as the counts, instead of the default when the 512-byte counts.
-x
Output only specified parameters use of space, not including subdirectories under it.
-s
Statistics only space on the same device used by the specified parameters.

 

GNU Options

-a, --all
Displays statistics for all files, not just Include subdirectories.
-b, --bytes
Output size in bytes, 1024 bytes counts when instead of the default.
--block-size= size
Output in units of blocks the size, block size to size bytes. (New option of file- utils-4.0)
-c, --total
All of these parameters are given in total after all arguments have been processed. This option is given by the sum of the space specified file or directory using a set of.
-D, --dereference-args
Command-line arguments reference characters are connected. But does not affect other symbolic links. This is / usr / disk usage useful to find out like this directory tmp, / usr / tmp, etc. are usually symbolic links. Live translation: for example, create a directory test at / var / tmp, and / usr / tmp is a symbolic link / var / tmp is. du / usr / tmp return a / usr / tmp, and du - D / usr / tmp two return / usr / tmp, / usr / tmp / test.
--exclude= pattern
When recursion ignore specified pattern that matches files or subdirectories. Mode may be any of the Bourne shell file glob pattern. (New option of file- utils-4.0)
-h, --human-readable
Each represents a number of additional units of letter size, expressed as a binary megabytes M.
-H, --si
-H parameter and play the same role, only use legal SI units (with powers of 1000 rather than the 1024 power, so M is represented by one million instead of 1048576). (The new option fileutils-4.0)
-k, --kilobytes
Output counts of 1024 bytes in size.
-l, --count-links
Statistics size of all files, including statistics had already (as a hard link).
-L, --dereference
Reference symbolic links (not show itself, but rather the connection point connection point of disk space used by the file or directory).
-m, --megabytes
Size (that is 1,048,576 bytes) megabytes of output counts of the blocks.
--max-depth= n
Total output-only command line parameters less than or equal to n-th layer directory. --max-depth = 0 is the same role in the -s option. (The new option fileutils-4.0)
-s, --summarize
It displays only the sum of each parameter.
-S, --separate-dirs
Reports the size of each directory separately, not including the sizes of subdirectories.
-x, --one-file-system
Ignore the parameters are processed not in the same file system directory.
-X file, --exclude-from= file
In addition to the pattern obtained from the specified file and --exclude same. Mode listed in rows. If the specified file is '-', is read out from the standard input mode. (Fileutils-4.0 new option) GNU Standard Options
--help
Exit normally on standard output after the output of help information.
--version
On standard output after the normal exit output version information.
--
End of option list

defect

For file from the HP-UX system NFS-mount on the size du reported on BSD systems is half correct values; for from BSD systems NFS-mount on the document, HP-UX system du reports the size of the correct value is doubled. This flaw is due to HP-UX, this flaw also affects the HP-UX du program.

variable

POSIXLY_CORRECT selected variable determining unit counts. If you do not set this variable and the value of the environment variable BLOCKSIZE to 'HUMAN' as a prefix, then, except in the case -k or -m option takes precedence in force, counts the same behavior in the -h option. Variable LANG, meaning LC_ALL, LC_CTYPE and LC_MESSAGES and literally the same. 

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11081503.html