Open polarathene opened 2 months ago
Thanks a lot for reporting!
I think this issue should remain focussed on making the size-on-disk include directories as consumer of a single block.
Supporting the --apparent-size
flag for interactive sessions (either interactively or using the flag) should be a separate issue, otherwise it might get lost here.
While experimenting with different distro images in Docker, I noticed that
du
anddua
were a bit inconsistent (and later thatdu
itself was inconsistent too with--apparent-size
if the version ofdu
was older).I discovered that
dua
reported/usr/share/man
as only 20KiB, butdu
was showing about 1MB. This location had many directories nested and most empty. Other locations were like this as well (I had been usingzypper --installroot /rootfs install glibc
for example to see how much space the package would weigh), contributing several MB in weight invisible todua
for this smallglibc
package (2.7MB of 10.7MB total). This is due to each directory using a minimum 4096 bytes as the smallest block-size, with a new enough version ofdu
the--apparent-size
option will treat these as 0 bytes.dua
has the-A
/--apparent-size
flag too, but without it directory size seems to still be treated as 0 bytes. Perhaps that is useful for some users vs usingdua -A
? 🤷♂️The linked discussion comment above suggested to raise an issue about this behaviour since it's technically a bug.
https://github.com/Byron/dua-cli/discussions/121#discussioncomment-10541462
It would be neat if
dua interactive
also supported toggling between--apparent-size
btw, which as a bonus would make it available in the TUI help view?