DU(1)

๐Ÿ‘‘ du(1) โ€” user commands, but make it a vibe

okay bestie, sit down, hydrate, because we're about to talk about du โ€” the little icon that walks your whole filesystem tree and tells you who's been eating all your disk space. it's giving detective energy. it's giving "who ate the last slice of pizza" energy. and honestly? it's essential. ๐Ÿ•ต๏ธโ€โ™€๏ธ๐Ÿ’–


โœจ NAME โœจ

du โ€” estimate file space usage ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

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

like, you can feed it a bunch of files, or you can feed it a file full of file names. both are valid. both are iconic. โœจ


๐Ÿ’– DESCRIPTION ๐Ÿ’–

so what it actually does: it summarizes device usage for the set of *FILE*s you hand it, and it goes recursively into directories. like it does not stop at the door. it goes in. it opens the drawers. it counts everything. ๐Ÿฆ‹

mandatory arguments to long options are mandatory for short options too โ€” that's not me being dramatic, that's just the rules, periodt.

  • -0, --null โ€” end each output line with NUL, not newline. perfect for when you're piping into something that hates newlines. no cap. ๐Ÿ’€
  • -a, --all โ€” write counts for all files, not just directories. yes, every single one. she's thorough.
  • -A, --apparent-size โ€” print apparent sizes rather than device usage. and here's the tea: apparent size is usually smaller, but it can be larger because of holes in ('sparse') files, internal fragmentation, indirect blocks, etc. so don't come for her when the numbers look weird. ๐Ÿซถ
  • -B, --block-size=SIZE โ€” scale sizes by SIZE before printing them. see SIZE format below. e.g., '-BM' prints sizes in units of 1,048,576 bytes. fancy!
  • -b, --bytes โ€” literally equivalent to '--apparent-size --block-size=1'. same thing, shorter name. slay.
  • -c, --total โ€” produce a grand total. the โœจgrand finaleโœจ.
  • -D, --dereference-args โ€” dereference only symlinks that are listed on the command line. just those. not the others. she's selective. ๐Ÿ’…
  • -d, --max-depth=N โ€” print the total for a directory (or file, with --all) only if it is N or fewer levels below the command line argument. and heads up: --max-depth=0 is the same as --summarize. ๐ŸŽ€
  • --files0-from=F โ€” summarize device usage of the NUL-terminated file names specified in file F. if F is -, read names from standard input. iykyk.
  • -H โ€” equivalent to --dereference-args (-D). twins fr fr.
  • -h, --human-readable โ€” print sizes in human readable format (e.g., 1K 234M 2G). my beloved. ๐Ÿฅฐ
  • --inodes โ€” list inode usage information instead of block usage. different currency, same chaos.
  • -k โ€” like --block-size=1K.
  • -L, --dereference โ€” dereference all symbolic links. all of them. no survivors. ๐Ÿ”ฅ
  • -l, --count-links โ€” count sizes many times if hard linked. yes, many times. she said what she said.
  • -m โ€” like --block-size=1M.
  • -P, --no-dereference โ€” don't follow any symbolic links. (this is the default) โ€” so if you're wondering why she's ignoring your symlinks, bestie, that's the default behavior. ๐Ÿ™ˆ
  • -S, --separate-dirs โ€” for directories, do not include size of subdirectories. keep it separate, keep it clean. โœจ
  • --si โ€” like -h, but use powers of 1000 not 1024. metric girlies rise. ๐ŸŒˆ
  • -s, --summarize โ€” display only a total for each argument. no details, just the receipts. ๐Ÿ’…
  • -t, --threshold=SIZE โ€” exclude entries smaller than SIZE if positive, or entries greater than SIZE if negative. yes, negative numbers do the opposite. mind the sign, queen. โญ
  • --time โ€” show time of the last modification of any file in the directory, or any of its subdirectories.
  • --time=WORD โ€” show time as WORD instead of modification time: atime, access, use, ctime or status. pick your fighter.
  • --time-style=STYLE โ€” time/date format with --time; see TIME_STYLE below. ๐ŸŽ€
  • -X, --exclude-from=FILE โ€” exclude files that match any pattern in FILE. a blocklist, basically.
  • --exclude=PATTERN โ€” exclude files that match PATTERN. bye bye ๐Ÿฆ‹
  • -x, --one-file-system โ€” skip directories on different file systems. stay in your lane (lovingly).
  • --help โ€” display this help and exit. always there for you. ๐Ÿซถ
  • --version โ€” output version information and exit. the origin story.

okay so 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). them's the rules. ๐Ÿ’–

the SIZE argument is an integer and an optional unit (example: 10K is 10*1024). units are K,M,G,T,P,E,Z,Y,R,Q (powers of 1024) or KB,MB,... (powers of 1000). binary prefixes can be used too: KiB=K, MiB=M, and so on. so many letters. so much power. ๐Ÿ‘‘

the --time-style STYLE argument can be full-iso, long-iso, iso, or +FORMAT. FORMAT is interpreted like in date(1). also the TIME_STYLE environment variable sets the default style to use. ๐Ÿ’…


๐ŸŽ€ PATTERNS ๐ŸŽ€

PATTERN is a shell pattern (not a regular expression โ€” important distinction bestie, do not come at her with regex).

  • the pattern ? matches any one character
  • whereas * matches any string (composed of zero, one or multiple characters)

for example, *.o will match any files whose names end in .o. therefore, the command

du --exclude='*.o'

will skip all files and subdirectories ending in .o (including the file .o itself). she said what she said and she meant it. ๐ŸŒธ


๐Ÿ’œ AUTHOR ๐Ÿ’œ

written by Torbjorn Granlund, David MacKenzie, Paul Eggert, and Jim Meyering. legends, honestly. ๐Ÿ‘‘


๐ŸŒˆ REPORTING BUGS ๐ŸŒˆ


copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.

this is free software: you are free to change and redistribute it. there is NO WARRANTY, to the extent permitted by law. (like, none. zero. don't @ me. ๐Ÿ’€)


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹


and that's the whole thing, bestie ๐Ÿซถ this was GNU coreutils 9.12, dated September 2026. now go free up some disk space, you gorgeous thing. ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from