pdu(1)

πŸ“¦ version 0.24.0, in nixpkgs unstable

πŸ’… pdu(1) β€” the disk usage glow-up manual πŸ’…

okay so bestie, welcome to the pdu page πŸ¦‹ this is the General Commands Manual entry and we're literally about to make disk usage make sense. periodt.


✨ NAME ✨

pdu β€” Summarize disk usage of the set of files, recursively for directories.

it's giving "your filesystem but make it a chart" and honestly? iconic. 🌸


πŸŽ€ SYNOPSIS πŸŽ€

pdu [--json-input] [--json-output] [-b|--bytes-format BYTES_FORMAT]
[-H|--deduplicate-hardlinks] [-x|--one-file-system] [--top-down]
[--align-right] [-q|--quantity QUANTITY] [-d|--max-depth MAX_DEPTH]
[-w|--total-width TOTAL_WIDTH] [--column-width TREE_WIDTH BAR_WIDTH]
[-m|--min-ratio MIN_RATIO] [--no-sort] [-s|--silent-errors]
[-p|--progress] [--threads THREADS] [--omit-json-shared-details]
[--omit-json-shared-summary] [-h|--help] [-V|--version] [FILES]...

lowkey a lot of flags but we'll get through it together, i promise 🫢


πŸ’– DESCRIPTION πŸ’–

Summarize disk usage of the set of files, recursively for directories.

Copyright: Apache-2.0 © 2021 Hoàng Văn Khải <https://github.com/KSXGitHub/> Sponsor: https://github.com/sponsors/KSXGitHub

ngl the copyright line is giving main character legal energy and we respect it πŸ’œ


🌈 OPTIONS 🌈

  • [FILES]... β€” List of files and/or directories. like, the stuff you actually wanna stare at in chart form πŸ‘€
  • --json-input β€” Read JSON data from stdin. it's eating from the JSON bowl instead of the filesystem, iykyk πŸ“
🚨 Cannot be used with --deduplicate-hardlinks, --one-file-system, --quantity. pick a lane bestie, you can't have both.
  • --json-output β€” Print JSON data instead of an ASCII chart. for when you want the data raw and unfiltered, no cap πŸ’€
  • -b, --bytes-format <BYTES_FORMAT> [default: metric] β€” How to display the numbers of bytes. the three moods of byte-sizing:
    • --bytes-format plain β€” Display plain number of bytes without units. just the number, nothing else, no thoughts head empty πŸ”’
    • --bytes-format metric β€” Use metric scale, i.e. 1K = 1000B, 1M = 1000K, and so on. the base-10Β³ slay ✨
    • --bytes-format binary β€” Use binary scale, i.e. 1K = 1024B, 1M = 1024K, and so on. base-2¹⁰ but make it cute πŸ’»
  • -H, --deduplicate-hardlinks, --detect-links, --dedupe-links β€” Detect and subtract the sizes of hardlinks from their parent directory totals. so your hardlinks stop double-counting like they're trying to be in two group chats at once πŸ™ˆ three aliases, one vibe, we love a multihyphenate.
🚨 Cannot be used with --json-input. fr fr.
  • -x, --one-file-system β€” Skip directories on different filesystems. stay in your lane, other filesystems, this chart is exclusive πŸ’…
🚨 Cannot be used with --json-input. noted.
  • --top-down β€” Print the tree top-down instead of bottom-up. flip the whole aesthetic, root at the top like a lil family tree πŸ‘‘
  • --align-right β€” Set the root of the bars to the right. bars grow leftward, it's giving mirror selfie πŸͺž
  • -q, --quantity <QUANTITY> [default: block-size] β€” Aspect of the files/directories to be measured. like, what are we even measuring bestie:
    • --quantity apparent-size β€” Measure apparent sizes. the ~vibes~ size, what it looks like on paper πŸ‘€
    • --quantity block-size β€” Measure block sizes (block-count * 512B). the actual disk footprint, the real real πŸ’€
    • --quantity block-count β€” Count numbers of blocks. just the blocks, no bytes attached, minimalism πŸ”’
🚨 Cannot be used with --json-input. we been knew.
  • -d, --max-depth, --depth <MAX_DEPTH> [default: 10] β€” Maximum depth to display the data. Could be either "inf" or a positive integer. go "inf" if you're feeling unhinged and fearless, or a cute lil number if you need boundaries 🌸
  • -w, --total-width, --width <TOTAL_WIDTH> β€” Width of the visualization. make it as wide as your terminal crush 😭
🚨 Cannot be used with --column-width. it's one or the other, babe.
  • --column-width <TREE_WIDTH> <BAR_WIDTH> β€” Maximum widths of the tree column and width of the bar column. two numbers, two columns, chef's kiss 🀌
🚨 Cannot be used with --total-width. again: pick one. πŸ’…
  • -m, --min-ratio <MIN_RATIO> [default: 0.01] β€” Minimal size proportion required to appear. the bouncer at the club, tiny files not on the list can't get in 🚫
  • --no-sort β€” Do not sort the branches in the tree. chaos mode: engaged. the tree is in its natural order, no editorializing πŸŒ€
  • -s, --silent-errors, --no-errors β€” Prevent filesystem error messages from appearing in stderr. shhh bestie, the errors are sleeping 😴 two aliases, zero drama.
  • -p, --progress β€” Report progress being made at the expense of performance. you get the little progress crumbs but you pay for them in speed, trade-offs are real 😭
  • --threads <THREADS> [default: auto] β€” Set the maximum number of threads to spawn. Could be either "auto", "max", or a positive integer. let pdu decide ("auto"), go feral ("max"), or pick your own number, you're the boss πŸ‘‘
  • --omit-json-shared-details β€” Do not output .shared.details in the JSON output. bye bye details node, you will not be missed πŸ’€
  • --omit-json-shared-summary β€” Do not output .shared.summary in the JSON output. summary? never heard of her πŸ™ˆ
  • -h, --help β€” Print help (see a summary with -h). the classic "help me help you" moment 🫢
  • -V, --version β€” Print version. know the vibe you're running πŸ’œ

πŸ¦‹ EXAMPLES πŸ¦‹

Show disk usage chart of current working directory

$ pdu

the "what is even in this folder" starter pack πŸŽ€

Show disk usage chart of a single file or directory

$ pdu path/to/file/or/directory

one target, one chart, laser focus ✨

Compare disk usages of multiple files and/or directories

$ pdu file.txt dir/

putting them side by side like it's a makeover episode πŸ’…

Show chart in apparent sizes instead of block sizes

$ pdu --quantity=apparent-size

what it says it is vs what it actually is, we chose the first one πŸ‘€

Detect and subtract the sizes of hardlinks from their parent nodes

$ pdu --deduplicate-hardlinks

no double-counting, no cap πŸ”₯

Show sizes in plain numbers instead of metric units

$ pdu --bytes-format=plain

just a number, raw and honest πŸ”’

Show sizes in base 2¹⁰ units (binary) instead of base 10³ units (metric)

$ pdu --bytes-format=binary

binary bestie behavior πŸ’»

Show disk usage chart of all entries regardless of size

$ pdu --min-ratio=0

no bouncer, everyone gets in, absolute chaos and i love it πŸŒ€

Only show disk usage chart of entries whose size is at least 5% of total

$ pdu --min-ratio=0.05

the 5%-and-up VIP section πŸ‘‘

Show disk usage data as JSON instead of chart

$ pdu --min-ratio=0 --max-depth=inf --json-output | jq

chart who? we're doing pipes and jq now, tech icon behavior 🧚

Visualize existing JSON representation of disk usage data

$ pdu --json-input < disk-usage.json

round two: this time the JSON is the input, slay πŸ”


⭐ VERSION ⭐

v0.24.0


and that's the whole page bestie, you ate that πŸ«ΆπŸ’–

pdu 0.24.0 β€” General Commands Manual β€” dated right there in the footer, so when you're citing this masterpiece just know it's the pdu 0.24.0 era πŸŽ€βœ¨

πŸ“¦ where this page comes from