Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

df: incorrect rounding behavior in Use% column #3208

Closed
cakebaker opened this issue Mar 3, 2022 · 0 comments
Closed

df: incorrect rounding behavior in Use% column #3208

cakebaker opened this issue Mar 3, 2022 · 0 comments
Labels
good first issue For newcomers!

Comments

@cakebaker
Copy link
Contributor

It looks like "GNU df" always rounds up the value in the "Use%" column, whereas "uutils df" doesn't. (I don't know why "GNU df" returns 28% for the /dev/sda8 filesystem, though, that seems incorrect)

$ df
Filesystem     1K-blocks      Used Available Use% Mounted on
dev              4006864         0   4006864   0% /dev
run              4014820      1340   4013480   1% /run
/dev/sda8      458091736 117418180 317380784  28% /
tmpfs            4014820     61244   3953576   2% /dev/shm
tmpfs            4014820      7012   4007808   1% /tmp
/dev/sda2         262144     83868    178276  32% /boot
tmpfs             802964        72    802892   1% /run/user/1000

$ ./target/debug/coreutils df
Filesystem          1k-blocks         Used    Available  Use% Mounted on       
dev                   4006864            0      4006864    0% /dev            
run                   4014820         1340      4013480    0% /run            
/dev/sda8           458091736    117418180    340673556   26% /               
tmpfs                 4014820        61244      3953576    2% /dev/shm        
tmpfs                 4014820         7012      4007808    0% /tmp            
/dev/sda2              262144        83868       178276   32% /boot           
tmpfs                  802964           72       802892    0% /run/user/1000
@sylvestre sylvestre added the good first issue For newcomers! label Mar 3, 2022
cakebaker added a commit to cakebaker/coreutils that referenced this issue Mar 3, 2022
cakebaker added a commit to cakebaker/coreutils that referenced this issue Mar 8, 2022
sylvestre added a commit that referenced this issue Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue For newcomers!
Projects
None yet
Development

No branches or pull requests

2 participants