DU(1)

✨ NAME ✨

okay so bestie, welcome to the du page β€” that's du, straight out of section 1 of the General Commands Manual, and she's here to estimate file space usage. πŸ’ΎπŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

du [OPTION]... [FILE]...
du [OPTION]... --files0-from=F

basically: options, then files. or the lil' second form where you point her at a file full of names instead. slay. πŸ’…


πŸ’– DESCRIPTION πŸ’–

Estimate file space usage. that's the whole thing. she's a size-girlie, she looks at your files and dirs and is like "that's how much you're taking up." πŸ”₯


πŸ‘‘ OPTIONS πŸ‘‘

  • --help β€” print help information. (she's helpful, she's kind, she's a queen 🫢)
  • -a, --all β€” write counts for all files, not just directories. the every-file treatment. no file left behind. ✨
  • -A, --apparent-size β€” print apparent sizes instead of disk usage. and like β€” yes, the apparent size is usually smaller, but ngl it can be bigger too, because of holes in ('sparse') files, internal fragmentation, indirect blocks, and the like. don't ask her to explain at a party. πŸ’€
  • -B, --block-size <SIZE> β€” scale sizes by SIZE before printing them. e.g., -BM prints sizes in units of 1,048,576 bytes. peep the SIZE format down below πŸ‘‡
  • -b, --bytes β€” equivalent to --apparent-size --block-size=1. the combo meal. πŸ“
  • -c, --total β€” produce a grand total. the SUM. the finale. main character energy. πŸ‘‘
  • -d, --max-depth <N> β€” print the total for a directory (or file, if you're running with --all) only if it's N or fewer levels below the command line argument. and heads up: --max-depth=0 is literally the same as --summarize. 😌
  • -h, --human-readable β€” print sizes in human readable format (e.g., 1K 234M 2G). no more 1048576 brain damage. 🌸
  • --inodes β€” list inode usage information instead of block usage, like --block-size=1K. different metric, same energy. 🌈
  • -k β€” like --block-size=1K. πŸ’œ
  • -l, --count-links β€” count sizes many times if hard linked. yes. many times. she said what she said. πŸ™ˆ
  • -L, --dereference β€” follow all symbolic links. all of them. 🌟
  • -D, --dereference-args β€” follow only the symlinks that are listed on the command line. picky, but valid. πŸ’…
  • -P, --no-dereference β€” don't follow any symbolic links. (this is the default, bestie β€” she was already doing this) πŸŽ€
  • -m β€” like --block-size=1M. 🧚
  • -0, --null β€” end each output line with a 0 byte rather than a newline. for when newlines just aren't the vibe. 🌸
  • -S, --separate-dirs β€” do not include size of subdirectories. keep 'em separated. βœ‚οΈ
  • -s, --summarize β€” display only a total for each argument. no detail, just the number. mysterious. iconic. πŸ’œ
  • --si β€” like -h, but use powers of 1000 not 1024. metric system girlies rise. πŸ¦‹
  • -x, --one-file-system β€” skip directories on different file systems. stay in your lane (lovingly). 🚧
  • -t, --threshold <SIZE> β€” exclude entries smaller than SIZE if positive, or entries greater than SIZE if negative. she's got range. ⭐
  • -v, --verbose β€” verbose mode. and fr fr: this option is not present in GNU/Coreutils. so don't come at her. πŸ‘€
  • --exclude <PATTERN> β€” exclude files that match PATTERN. bye felicia. πŸ‘‹
  • -X, --exclude-from <FILE> β€” exclude files that match any pattern in FILE. the whole list, gone. πŸ’«
  • --files0-from <FILE> β€” summarize device usage of the NUL-terminated file names specified in file F; if F is -, then read names from standard input. 🫢
  • --time[=<WORD>...] β€” show time of the last modification of any file in the directory, or any of its subdirectories. if WORD is given, show time as WORD instead of modification time: atime, access, use, ctime, status, birth or creation.

Possible values:

  • atime
  • ctime
  • creation
  • --time-style <STYLE> β€” show times using style STYLE: full-iso, long-iso, iso, +FORMAT. and FORMAT is interpreted like date. πŸ“…
  • -V, --version β€” print version. the lore. πŸ’–

🌈 EXTRA 🌈

Display values are in units of the first available SIZE from --block-size, and the DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables. Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set). so yes, the env vars get a say. πŸ™ˆ

SIZE is an integer and optional unit (example: 10M is 10*1024*1024). Units are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB, ... (powers of 1000). Units can be decimal, hexadecimal, octal, binary. so many flavours, all valid. πŸ“

PATTERN allows some advanced exclusions. For example, the following syntaxes are supported:

  • ? will match only one character
  • * will match zero or more characters
  • {a,b} will match a or b

πŸ¦‹ VERSION πŸ¦‹

v(uutils coreutils) 0.12.0


πŸ’… EXAMPLES πŸ’…

List the sizes of a directory and any subdirectories, in the given unit (B/KiB/MiB):

du -b|k|m path/to/directory

List the sizes of a directory and any subdirectories, in human-readable form (i.e. auto-selecting the appropriate unit for each size):

du [-h|--human-readable] path/to/directory

Show the size of a single directory, in human-readable units:

du [-sh|--summarize --human-readable] path/to/directory

List the human-readable sizes of a directory and of all the files and directories within it:

du [-ah|--all --human-readable] path/to/directory

List the human-readable sizes of a directory and any subdirectories, up to n levels deep:

du [-h|--human-readable] [-d|--max-depth] n path/to/directory

List the human-readable size of all .jpg files in current directory, and show a cumulative total at the end:

du [-ch|--total --human-readable] *.jpg

List all files and directories (including hidden ones) above a certain threshold size (useful for investigating what is actually taking up the space):

du [-ah|--all --human-readable] [-t|--threshold] 1G|1024M|1048576K
.[^.]* *
The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail.

(ngl that last bit is important β€” she's still growing, so some examples might flop. not her fault, she's a work in progress and we love her for it πŸ˜­πŸ’–)


<div align="center">🌸 🌸 🌸</div>

okay bestie that's the whole page!! this was the DU(1) manual, and it's dated 2026-09-25 β€” go free up some disk space, you've got this, mwah πŸ’‹βœ¨πŸ¦‹

πŸ“¦ where this page comes from