DUT(1)

πŸ“¦ version 0-unstable-2024-07, in nixos 26.05, nixpkgs unstable

πŸ’– DUT β€” disk usage calculator πŸ’–

okay so this is dut, a General Commands Manual page (section 1, bestie β€” the "commands you just type" section) ✨


✨ NAME ✨

dut β€” the disk usage calculator. that's it. that's the whole name. iconic behavior honestly πŸŽ€


🌸 SYNOPSIS 🌸

dut [-cClsbphv] [-d depth] [-i indent] [-n rows] [-t threads] [path...]

look at all those little flags. she's got range πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

dut is a multi-threaded disk usage calculator for Linux β€” and yes she is capable of deduplicating hardlinks, which is lowkey the whole flex πŸ”₯

if you invoke it with no argument at all, dut will calculate disk usage for the current working directory. otherwise, dut will do the same thing for all the directories you list in path... 🫢

πŸŽ€ Output Format πŸŽ€

dut shows a summary of all the files reachable from path... in a tree-like format</>. if you specify multiple directories in path..., you'll get a dummy (total) tree node created at the bottom of the output β€” like a little grand finale node πŸ‘‘

the output has two columns:

  • the size column</> β€” shows the total size taken up by this entry
  • the β€œshared space” column</> β€” tells you how much of that total is taken up by files hardlinked to other places in the filesystem

in the example below, dut displays the disk usage of example as 12 kilobytes, consisting of files 1, 2, and 3. 1 and 2 are indicated by the second column to be hardlinks, because they have a non-zero shared size bestie πŸ’€ and because example's second column is 0, we can assume they're hardlinks of each other, since they're the only hardlinks inside of example. but if they were instead linked to files elsewhere on the filesystem, example's shared size column would show that 8K is shared with other directories instead ✨

$ dut ./example
 4.0K  4.0K |- 2
 4.0K    0B |- 3
 4.0K  4.0K /- 1
  12K    0B example

πŸ’… OPTIONS πŸ’…

  • -c β€” disable colorized output. same effect as a non-empty value in the NO_COLOR environmental variable 🌈
  • -C β€” force colorized output. this overrides the environmental variable NO_COLOR β€” she said color, and she meant it πŸ’…
  • -l β€” don't deduplicate hardlinks when traversing the filesystem. this option causes dut to only show the first column of output πŸ‘€
  • -b β€” show sizes in plain bytes instead of human readable format. no more Ks and Ms, just raw numbers πŸ“
  • -s β€” count size of files instead of size on disk πŸ¦‹
  • -p β€” display the full path of files in the tree 🌸
  • -d depth β€” limit the depth of the displayed tree to depth levels πŸŽ€
  • -i indentation β€” specify the number of spaces for each level of indentation in the displayed tree. the default is 2 ✨
  • -n rows β€” specify the number of rows to show. the default is the terminal height minus 10 πŸ‘‘
  • -t threads β€” number of threads to use for scanning the filesystem. the default is 4 or the number of available CPUs, whichever is greater (see sched_getaffinity(2)) πŸ”₯
  • -h β€” display a help message 🫢
  • -v β€” display version information ⭐

🌈 ENVIRONMENT 🌈

if the NO_COLOR environmental variable has a non-empty value, then the output will not include any color β€” see the -c option, and also https://no-color.org/ πŸ’œ


⭐ EXIT STATUS ⭐

the dut utility exits 0 on success, and >0 if an error occurs. simple as that, no cap πŸ’€


🧚 SEE ALSO 🧚

du(1), ncdu(1), dust(1), gdu(1) β€” the whole disk-usage friend group, fr fr 🫢


ngl this page is from Debian, dated July 13, 2023 β€” that's the source, the version, and the date all in one, so consider this the cute little sign-off bestie πŸ’–βœ¨πŸŽ€
πŸ“¦ where this page comes from