[GH-ISSUE #570] dust shows IEC values with SI prefixes #244

Open
opened 2026-06-08 11:26:18 +03:00 by zhus · 0 comments
Owner

Originally created by @Zorbatron on GitHub (Apr 14, 2026).
Original GitHub issue: https://github.com/bootandy/dust/issues/570

The manual shows these options for --output-format:

  • si
  • b
  • k - t for KiB - TiB (IEC)
  • kb - tb for KB - TB (SI)

To me, this implies that it defaults to SI prefixes, and the output using M or G suggests the same. However the reported sizes are actually using IEC prefixes and are "larger" when specifying -o si.

Testing with these files:

$ fallocate -l 1000000000 1GB.bin
$ fallocate -l 1G 1GiB.bin
$ fallocate -l 1000000 1MB.bin
$ fallocate -l 1M 1MiB.bin

eza shows the correct units:

$ eza -l --no-permissions --no-user --no-time (default is SI)
1.0G 1GB.bin
1.1G 1GiB.bin
1.0M 1MB.bin
1.0M 1MiB.bin

$ eza -l --no-permissions --no-user --no-time -b (for IEC prefixes)
954Mi 1GB.bin
1.0Gi 1GiB.bin
977Ki 1MB.bin
1.0Mi 1MiB.bin

$ eza -l --no-permissions --no-user --no-time -B (for plain byte count)
1,000,000,000 1GB.bin
1,073,741,824 1GiB.bin
    1,000,000 1MB.bin
    1,048,576 1MiB.bin

Whereas dust doesn't differentiate between SI and IEC:

$ dust -bo si
1.0M   ┌── 1MB.bin
1.0M   ├── 1MiB.bin
1.0G   ├── 1GB.bin
1.1G   ├── 1GiB.bin
2.1G ┌─┴ .

$ dust -b
980K   ┌── 1MB.bin
1.0M   ├── 1MiB.bin
953M   ├── 1GB.bin
1.0G   ├── 1GiB.bin
1.9G ┌─┴ .

$ dust -bo b
   1003520B   ┌── 1MB.bin
   1048576B   ├── 1MiB.bin
1000001536B   ├── 1GB.bin
1073741824B   ├── 1GiB.bin
2075795456B ┌─┴ .

(Idk why dust reads a wrong size for the SI files, eza, GNU ls, and GNU du don't do this)

When printing the sizes with IEC prefixes, it should be Ki/Mi/Gi/Ti. The man page should also mention that it defaults to IEC prefixes.

Originally created by @Zorbatron on GitHub (Apr 14, 2026). Original GitHub issue: https://github.com/bootandy/dust/issues/570 The manual shows these options for `--output-format`: - `si` - `b` - `k` - `t` for `KiB` - `TiB` (IEC) - `kb` - `tb` for `KB` - `TB` (SI) To me, this implies that it defaults to SI prefixes, and the output using `M` or `G` suggests the same. However the reported sizes are actually using IEC prefixes and are "larger" when specifying `-o si`. Testing with these files: ``` $ fallocate -l 1000000000 1GB.bin $ fallocate -l 1G 1GiB.bin $ fallocate -l 1000000 1MB.bin $ fallocate -l 1M 1MiB.bin ``` `eza` shows the correct units: ``` $ eza -l --no-permissions --no-user --no-time (default is SI) 1.0G 1GB.bin 1.1G 1GiB.bin 1.0M 1MB.bin 1.0M 1MiB.bin $ eza -l --no-permissions --no-user --no-time -b (for IEC prefixes) 954Mi 1GB.bin 1.0Gi 1GiB.bin 977Ki 1MB.bin 1.0Mi 1MiB.bin $ eza -l --no-permissions --no-user --no-time -B (for plain byte count) 1,000,000,000 1GB.bin 1,073,741,824 1GiB.bin 1,000,000 1MB.bin 1,048,576 1MiB.bin ``` Whereas `dust` doesn't differentiate between SI and IEC: ``` $ dust -bo si 1.0M ┌── 1MB.bin 1.0M ├── 1MiB.bin 1.0G ├── 1GB.bin 1.1G ├── 1GiB.bin 2.1G ┌─┴ . $ dust -b 980K ┌── 1MB.bin 1.0M ├── 1MiB.bin 953M ├── 1GB.bin 1.0G ├── 1GiB.bin 1.9G ┌─┴ . $ dust -bo b 1003520B ┌── 1MB.bin 1048576B ├── 1MiB.bin 1000001536B ├── 1GB.bin 1073741824B ├── 1GiB.bin 2075795456B ┌─┴ . ``` (Idk why `dust` reads a wrong size for the SI files, `eza`, GNU `ls`, and GNU `du` don't do this) When printing the sizes with IEC prefixes, it should be `Ki`/`Mi`/`Gi`/`Ti`. The man page should also mention that it defaults to IEC prefixes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#244