3 ms·
I've been using my own function with `du` for ages now, similar to others here, but I appreciate new tools in this space. I gave `dut` a try, but I'm confused
by imiric 2y ago
I've been using my own function with `du` for ages now, similar to others here, but I appreciate new tools in this space.
I gave `dut` a try, but I'm confused by its output. For example:
3.2G 0B |- .pyenv
3.4G 0B | /- toolchains
3.4G 0B |- .rustup
4.0G 0B | |- <censored>
4.4G 0B | /- <censored>
9.2G 0B |- Work
3.7G 0B | /- flash
3.8G 0B | /- <censored>
16G 4.0K |- Downloads
5.1G 0B | |- <censored>
5.2G 0B | /- <censored>
16G 0B |- Projects
3.2G 42M | /- <censored>
17G 183M |- src
17G 0B | /- <censored>
17G 0B |- Videos
3.7G 0B | /- Videos
28G 0B |- Music
6.9G 0B | |- tmp
3.4G 0B | | /- tmp
8.8G 0B | |- go
3.6G 0B | | /- .versions
3.9G 0B | | |- go
8.5G 0B | | | /- dir
8.5G 0B | | | /- vfs
8.5G 0B | | | /- storage
8.5G 0B | | /- containers
15G 140M | /- share
34G 183M /- .local
161G 0B .
- I expected the output to be sorted by the first column, yet some items are clearly out of order. I don't use hard links much, so I wouldn't expect this to be because of shared data.
- The tree rendering is very confusing. Some directories are several levels deep, but in this output they're all jumbled, so it's not clear where they exist on disk. Showing the full path with the `-p` option, and removing indentation with `-i 0` somewhat helps, but I would almost remove tree rendering entirely.
- 201984 2y agoIt is being sorted by the first column, but it also keeps subdirectories with each other. Look at the order of your top-level directories. 3.2G 0B |- .pyenv 3.4G 0B |- .rustup 9.2G 0B |- Work 16G 4.0K |- Downloads 17G 183M |- src 28G 0B |- Music 34G 183M /- .local If you don't want the tree output and only want the top directories, you can use `-d 1` to limit to depth=1.
- imiric 2y agoAh, I see, that makes sense. But still, the second `Videos` directory of 3.7G is a subdirectory of `Music`, so it should appear below it, no? Same for the two `tmp` directories, they're subdirectories of `.local`, so I would expect them to be listed under it. Right now there doesn't seem to be a clear order in either case.
- db48x 2y agoSubdirectories cannot be larger than the directory that they are within, so they cannot be sorted _below_ their parent. Thus, the tree branches upwards, not downwards. The root is at the bottom, where a tree’s root should be! Incidentally, dust sorts things the same way but presents it with a nicer tree: db48x ~ 1 dust -Db 2.6G ┌── saves 2.6G ┌─┴ .factorio 3.4G │ ┌── Steam 3.4G │ ┌─┴ share 3.4G ├─┴ .local 1.8G │ ┌── EgoSoft 3.5G ├─┴ .config 7.2G │ ┌── Amadeus (1984) DC (1080p BluRay x265 HEVC 10bit AAC 5.1 Tigole) 16G │ ├── Amadeus.1984.DC.INTERNAL.REPACK.1080p.BluRay.x264-CLASSiC[rarbg] 23G ├─┴ video 1.9G │ ┌── build 2.0G │ ┌─┴ notcurses 2.2G │ ├── wezterm 2.1G │ │ ┌── master 2.6G │ │ │ ┌── tiles 2.6G │ │ │ ┌─┴ obj 4.1G │ │ ├─┴ missions 2.6G │ │ │ ┌── tiles 2.6G │ │ │ ┌─┴ obj 4.1G │ │ ├─┴ iteminfo 5.6G │ │ ├── follower_rules 8.5G │ │ │ ┌── pack 8.6G │ │ │ ┌─┴ objects 8.6G │ │ │ ┌─┴ .git 10G │ │ ├─┴ uilist 26G │ ├─┴ cataclysm 33G ├─┴ src 72G ┌─┴ .
- imiric 2y agoGotcha, thanks for explaining. Yeah, I guess my confusion was with how the tree is rendered in dut. The pipe rendering of dust makes this clearer.