首页
首页 » 磁盘管理 » du(disk usage)

du(disk usage)

du(disk usage)
功能说明:显示目录或文件的大小。
语  法:du [-abcDhHklmsSx][-L <符号连接>][-X <文件>][--block-size][--exclude=<目录或文件>][--max-depth=<目录层数>][--help][--version][目录或文件]
补充说明:du会显示指定的目录或文件所占用的磁盘空间。
参  数:
  -a或-all   显示目录中个别文件的大小。
  -b或-bytes   显示目录或文件大小时,以byte为单位。
  -c或--total   除了显示个别目录或文件的大小外,同时也显示所有目录或文件的总和。
  -D或--dereference-args   显示指定符号连接的源文件大小。
  -h或--human-readable   以K,M,G为单位,提高信息的可读性。
  -H或--si   与-h参数相同,但是K,M,G是以1000为换算单位。
  -k或--kilobytes   以1024 bytes为单位。
  -l或--count-links   重复计算硬件连接的文件。
  -L<符号连接>或--dereference<符号连接>   显示选项中所指定符号连接的源文件大小。
  -m或--megabytes   以1MB为单位。
  -s或--summarize   仅显示总计。
  -S或--separate-dirs   显示个别目录的大小时,并不含其子目录的大小。
  -x或--one-file-xystem   以一开始处理时的文件系统为准,若遇上其它不同的文件系统目录则略过。
  -X<文件>或--exclude-from=<文件>   在<文件>指定目录或文件。
  --exclude=<目录或文件>   略过指定的目录或文件。
  --max-depth=<目录层数>   超过指定层数的目录后,予以忽略。
  --help   显示帮助。
  --version   显示版本信息。

du

du [options] [directories]

Print disk usage (as the number of 1 KB blocks used by each named directory and its subdirectories; default is the current directory).

Options

-a, --all

Print disk usage for all files, not just subdirectories.

-b, --bytes

Print sizes in bytes.

-c, --total

In addition to normal output, print grand total of all arguments.

-D, --dereference-args

Follow symbolic links, but only if they are command-line arguments.

-h, --human-readable

Print sizes in human-readable format.

-H, --si

Like -h, but show as power of 1000 rather than 1024.

-k, --kilobytes

Print sizes in kilobytes (this is the default).

-l, --count-links

Count the size of all files, whether or not they have already appeared (i.e., via a hard link).

-L, --dereference

Follow symbolic links.

--exclude=pattern

Exclude files that match pattern.

--max-depth=num

Report sizes for directories only down to num levels below the starting point (which is level 0).

-m, --megabytes

Print sizes in megabytes.

-s, --summarize

Print only the grand total for each named directory.

-S, --separate-dirs

Do not include the sizes of subdirectories when totaling the size of parent directories.

-x, --one-file-system

Display usage of files in current filesystem only.

-X, --exclude-from=file

Exclude files that match any pattern in file.

--help

Print help message and then exit.

--version

Print the version and then exit.