[RFC] df,du,ls: less aggressive ceiling for --human-readable
From:
Lukáš Zaoral
Subject:
[RFC] df,du,ls: less aggressive ceiling for --human-readable
Date:
Wed, 8 Oct 2025 14:00:50 +0200
Hello,
we have an RFE in RHEL (the ticket is, unfortunately, private) to make the
ceiling provided by the human_readable function from gnulib used by ls(1),
df(1) and du(1) less aggressive if the integral part has two digits.
For example, a file slightly larger than 10T gets immediately rounded to 11T:
$ truncate --size 10T /var/tmp/test
$ ls -l -h /var/tmp/test
-rw-r--r--. 1 root root 10T Oct 8 11:22 /var/tmp/test
$ truncate --size +1 /var/tmp/test
$ ls -l -h /var/tmp/test
-rw-r--r--. 1 root root 11T Oct 8 11:22 /var/tmp/test
The users were made aware of numfmt(1) for custom formatting. However, they
still expressed interest in changing the upstream default to always show one
digit of the fractional part also in the case of two-digit integral parts to
improve the precision.
I know that the current behaviour has been in use for a long time and changing
it may be potentially breaking. Therefore, I'd like to hear the opinions of
other coreutils users first.
Thank you!
Regards,
Lukas