[GH-ISSUE #269] Feature request: only list files and sort them by size #115

Closed
opened 2026-06-08 11:25:45 +03:00 by zhus · 2 comments
Owner

Originally created by @certik on GitHub (Oct 18, 2022).
Original GitHub issue: https://github.com/bootandy/dust/issues/269

First of all, thank you for this program, it does exactly what I was looking for. In fact, I knew Rust will have this, so I just searched "rust cli better du", and it came up. :)

Here is what would be nice to have as a compiler option. Instead of showing this:

$ dust  
4.0K   ┌── cpptranslate.cpp   │                                         █ │   1%
4.0K   ├── example_input.txt  │                                         █ │   1%
4.0K   ├── parse.cpp          │                                         █ │   1%
4.0K   ├── parse2.cpp         │                                         █ │   1%
4.0K   ├── parse3.cpp         │                                         █ │   1%
8.0K   ├── dwarf_convert.py   │                                         █ │   2%
 12K   ├── CMakeLists.txt     │                                         █ │   2%
4.0K   │   ┌── whereami.h     │                                    ░░░░▒█ │   1%
 16K   │   ├── whereami.cpp   │                                    ░░░░██ │   3%
 20K   │ ┌─┴ whereami         │                                    ░░░░██ │   4%
8.0K   │ │ ┌── terminal_base.h│                                    ░░▒▒▒█ │   2%
 12K   │ │ ├── prompt0.h      │                                    ░░▒▒▒█ │   2%
 24K   │ │ ├── terminal.h     │                                    ░░▒▒██ │   5%
 44K   │ ├─┴ cpp-terminal     │                                    ░░████ │   9%
 64K   ├─┴ tpl                │                                    ██████ │  12%
 68K   ├── lfortran.cpp       │                                    ██████ │  13%
344K   ├── CLI11.hpp          │             █████████████████████████████ │  67%
516K ┌─┴ .                    │██████████████████████████████████████████ │ 100%

Show this:

4.0K   ┌── cpptranslate.cpp   │                                         █ │   1%
4.0K   ├── example_input.txt  │                                         █ │   1%
4.0K   ├── parse.cpp          │                                         █ │   1%
4.0K   ├── parse2.cpp         │                                         █ │   1%
4.0K   ├── parse3.cpp         │                                         █ │   1%
4.0K   │   ┌── whereami.h     │                                    ░░░░▒█ │   1%
8.0K   ├── dwarf_convert.py   │                                         █ │   2%
8.0K   │ │ ┌── terminal_base.h│                                    ░░▒▒▒█ │   2%
 12K   ├── CMakeLists.txt     │                                         █ │   2%
 12K   │ │ ├── prompt0.h      │                                    ░░▒▒▒█ │   2%
 16K   │   ├── whereami.cpp   │                                    ░░░░██ │   3%
 24K   │ │ ├── terminal.h     │                                    ░░▒▒██ │   5%
 68K   ├── lfortran.cpp       │                                    ██████ │  13%
344K   ├── CLI11.hpp          │             █████████████████████████████ │  67%
516K ┌─┴ .                    │██████████████████████████████████████████ │ 100%

Notice that the order changes, now the files are sorted by size no matter where they are in the directory tree. The lines on the left need to be polished, and on the right probably only show one bar, not the fraction of the directory.

Originally created by @certik on GitHub (Oct 18, 2022). Original GitHub issue: https://github.com/bootandy/dust/issues/269 First of all, thank you for this program, it does exactly what I was looking for. In fact, I knew Rust will have this, so I just searched "rust cli better du", and it came up. :) Here is what would be nice to have as a compiler option. Instead of showing this: ``` $ dust 4.0K ┌── cpptranslate.cpp │ █ │ 1% 4.0K ├── example_input.txt │ █ │ 1% 4.0K ├── parse.cpp │ █ │ 1% 4.0K ├── parse2.cpp │ █ │ 1% 4.0K ├── parse3.cpp │ █ │ 1% 8.0K ├── dwarf_convert.py │ █ │ 2% 12K ├── CMakeLists.txt │ █ │ 2% 4.0K │ ┌── whereami.h │ ░░░░▒█ │ 1% 16K │ ├── whereami.cpp │ ░░░░██ │ 3% 20K │ ┌─┴ whereami │ ░░░░██ │ 4% 8.0K │ │ ┌── terminal_base.h│ ░░▒▒▒█ │ 2% 12K │ │ ├── prompt0.h │ ░░▒▒▒█ │ 2% 24K │ │ ├── terminal.h │ ░░▒▒██ │ 5% 44K │ ├─┴ cpp-terminal │ ░░████ │ 9% 64K ├─┴ tpl │ ██████ │ 12% 68K ├── lfortran.cpp │ ██████ │ 13% 344K ├── CLI11.hpp │ █████████████████████████████ │ 67% 516K ┌─┴ . │██████████████████████████████████████████ │ 100% ``` Show this: ``` 4.0K ┌── cpptranslate.cpp │ █ │ 1% 4.0K ├── example_input.txt │ █ │ 1% 4.0K ├── parse.cpp │ █ │ 1% 4.0K ├── parse2.cpp │ █ │ 1% 4.0K ├── parse3.cpp │ █ │ 1% 4.0K │ ┌── whereami.h │ ░░░░▒█ │ 1% 8.0K ├── dwarf_convert.py │ █ │ 2% 8.0K │ │ ┌── terminal_base.h│ ░░▒▒▒█ │ 2% 12K ├── CMakeLists.txt │ █ │ 2% 12K │ │ ├── prompt0.h │ ░░▒▒▒█ │ 2% 16K │ ├── whereami.cpp │ ░░░░██ │ 3% 24K │ │ ├── terminal.h │ ░░▒▒██ │ 5% 68K ├── lfortran.cpp │ ██████ │ 13% 344K ├── CLI11.hpp │ █████████████████████████████ │ 67% 516K ┌─┴ . │██████████████████████████████████████████ │ 100% ``` Notice that the order changes, now the files are sorted by size no matter where they are in the directory tree. The lines on the left need to be polished, and on the right probably only show one bar, not the fraction of the directory.
zhus closed this issue 2026-06-08 11:25:45 +03:00
Author
Owner

@bootandy commented on GitHub (Oct 19, 2022):

Order by size no matter where they are in the directory tree.

So as you say I think we can only draw one bar on the right with a single shade.
On the left I think the tree view would get too messy. However we could side-step the problem by running as 'dust -p' which shows the full path of each file.

yes we can look at adding a flag to do this.

<!-- gh-comment-id:1284448654 --> @bootandy commented on GitHub (Oct 19, 2022): **Order by size no matter where they are in the directory tree.** So as you say I think we can only draw one bar on the right with a single shade. On the left I think the tree view would get too messy. However we could side-step the problem by running as 'dust -p' which shows the full path of each file. yes we can look at adding a flag to do this.
Author
Owner

@bootandy commented on GitHub (Jan 29, 2023):

done.
dust -F will work in version 0.8.4

<!-- gh-comment-id:1407616143 --> @bootandy commented on GitHub (Jan 29, 2023): done. dust -F will work in version 0.8.4
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#115