du -BM behaves differently from GNU version
Open
Nobody has claimed this yet.
U - du
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
du -BM does not print unit:
sveta@lemurr:~/src/thirdparty/coreutils$ du --version
du (uutils coreutils) 0.8.0
sveta@lemurr:~/src/thirdparty/coreutils$ du -BM | head
2 ./man
1 ./.git/refs/heads
1 ./.git/refs/tags
1 ./.git/refs/remotes/origin
1 ./.git/refs/remotes
1 ./.git/refs
1 ./.git/objects/info
51 ./.git/objects/pack
51 ./.git/objects
1 ./.git/logs/refs/heads
Here is the output of the GNU version:
sveta@lemurr:~/src/thirdparty/coreutils$ ./src/du --version
du (GNU coreutils) 9.11.131-68f15
Copyright (C) 2026 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Torbjörn Granlund, David MacKenzie, Paul Eggert,
and Jim Meyering.
sveta@lemurr:~/src/thirdparty/coreutils$ ./src/du -BM | head
2M ./man
1M ./.git/refs/heads
1M ./.git/refs/tags
1M ./.git/refs/remotes/origin
1M ./.git/refs/remotes
1M ./.git/refs
1M ./.git/objects/info
51M ./.git/objects/pack
51M ./.git/objects
1M ./.git/logs/refs/heads
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the du command entry point and reproduce the shown du -BM output alongside the GNU example. Trace the handling of the -BM option and verify that completed output includes the M suffix without changing other units or paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100