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

du -h --apparent-size adds an extra zero on stdout . #6159

Closed
AnirbanHalder654322 opened this issue Mar 31, 2024 · 0 comments · Fixed by #6226
Closed

du -h --apparent-size adds an extra zero on stdout . #6159

AnirbanHalder654322 opened this issue Mar 31, 2024 · 0 comments · Fixed by #6226
Labels

Comments

@AnirbanHalder654322
Copy link
Contributor

AnirbanHalder654322 commented Mar 31, 2024

Steps to reproduce
GNU coreutils

truncate -s12M a
du -h --apparent-size a
12M	a

uutils-coreutils

truncate -s12M a
./coreutils/target/release/coreutils du -h --apparent-size a
12.0M	a

Works the same for any two and three digit sizes K and M .

mvo5 added a commit to mvo5/coreutils that referenced this issue Apr 1, 2024
When printing the `du -h` output GNU coreutils does not print
fractions of the size, only the full number. E.g.:
```
truncate -s12M a
du -h --apparent-size a
12M	a
```
Align our version to do the same.

Closes: uutils#6159
mvo5 added a commit to mvo5/coreutils that referenced this issue Apr 1, 2024
When printing the `du -h` output GNU coreutils does not print
fractions of the size, only the full number. E.g.:
```
truncate -s12M a
du -h --apparent-size a
12M	a
```
Align our version to do the same.

Closes: uutils#6159
mvo5 added a commit to mvo5/coreutils that referenced this issue Apr 1, 2024
When printing the `du -h` output GNU coreutils does autoscale
the size, e.g.
```
$ truncate -s12M a
$ truncate -s8500 b
$ truncate -s133456345 c
$ truncate -s56990456345 d
$ du -h --apparent-size a b c d
12M	a
8,4K	b
128M	c
54G	d
```
Align our version to do the same.

Closes: uutils#6159
mvo5 added a commit to mvo5/coreutils that referenced this issue Apr 1, 2024
When printing the `du -h` output GNU coreutils does autoscale
the size, e.g.
```
$ truncate -s12M a
$ truncate -s8500 b
$ truncate -s133456345 c
$ truncate -s56990456345 d
$ du -h --apparent-size a b c d
12M	a
8,4K	b
128M	c
54G	d
```
Align our version to do the same.

Closes: uutils#6159
mvo5 added a commit to mvo5/coreutils that referenced this issue Apr 13, 2024
When printing the `du -h` output GNU coreutils does autoscale
the size, e.g.
```
$ truncate -s12M a
$ truncate -s8500 b
$ truncate -s133456345 c
$ truncate -s56990456345 d
$ du -h --apparent-size a b c d
12M	a
8,4K	b
128M	c
54G	d
```
Align our version to do the same by sharing the code with `ls`.

Closes: uutils#6159
mvo5 added a commit to mvo5/coreutils that referenced this issue Apr 13, 2024
When printing the `du -h` output GNU coreutils does autoscale
the size, e.g.
```
$ truncate -s12M a
$ truncate -s8500 b
$ truncate -s133456345 c
$ truncate -s56990456345 d
$ du -h --apparent-size a b c d
12M	a
8,4K	b
128M	c
54G	d
```
Align our version to do the same by sharing the code with `ls`.

Closes: uutils#6159
mvo5 added a commit to mvo5/coreutils that referenced this issue Apr 13, 2024
When printing the `du -h` output GNU coreutils does autoscale
the size, e.g.
```
$ truncate -s12M a
$ truncate -s8500 b
$ truncate -s133456345 c
$ truncate -s56990456345 d
$ du -h --apparent-size a b c d
12M	a
8,4K	b
128M	c
54G	d
```
Align our version to do the same by sharing the code with `ls`.

Closes: uutils#6159
cakebaker pushed a commit to mvo5/coreutils that referenced this issue Apr 24, 2024
When printing the `du -h` output GNU coreutils does autoscale
the size, e.g.
```
$ truncate -s12M a
$ truncate -s8500 b
$ truncate -s133456345 c
$ truncate -s56990456345 d
$ du -h --apparent-size a b c d
12M	a
8,4K	b
128M	c
54G	d
```
Align our version to do the same by sharing the code with `ls`.

Closes: uutils#6159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants