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.,-BMprints 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=0is literally the same as--summarize. π-h,--human-readableβ print sizes in human readable format (e.g.,1K234M2G). 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,birthorcreation.
Possible values:
atimectimecreation
--time-style <STYLE>β show times using style STYLE:full-iso,long-iso,iso,+FORMAT. andFORMATis interpreted likedate. π-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 matchaorb
π¦ 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
- ubuntu stonking: rust-coreutils 0.12.0-1ubuntu2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms