[GH-ISSUE #231] How can I ignore file sizes that are smaller than 100k #103

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

Originally created by @avatar-lavventura on GitHub (Jul 31, 2022).
Original GitHub issue: https://github.com/bootandy/dust/issues/231

I was wondering is it possible to ignore file sizes that are smaller than 100k.

For example I dont want to see following files since they are 4.0K

$ dust
 4.0K    .bashrc
 4.0K    .gitignore
 4.0K    .gitmodules
 4.0K    .pre-commit-config.yaml
 4.0K    .text
 4.0K    README.md
Originally created by @avatar-lavventura on GitHub (Jul 31, 2022). Original GitHub issue: https://github.com/bootandy/dust/issues/231 I was wondering is it possible to ignore file sizes that are smaller than 100k. For example I dont want to see following files since they are `4.0K` ``` $ dust 4.0K .bashrc 4.0K .gitignore 4.0K .gitmodules 4.0K .pre-commit-config.yaml 4.0K .text 4.0K README.md ```
zhus closed this issue 2026-06-08 11:25:42 +03:00
Author
Owner

@bootandy commented on GitHub (Aug 8, 2022):

There isn't currently an option to do that. I'm not keen on adding it because what about if you had a lot of 4K files that added up to more than 100K should they be included then ?

Consider root/subdir1/ inside subdir1 we have a lot of 4K files:

dust --min-size 5k
200K root
100K  - subdir1
????      - (Why is nothing here the above directory said there was 100K here?)
<!-- gh-comment-id:1207825732 --> @bootandy commented on GitHub (Aug 8, 2022): There isn't currently an option to do that. I'm not keen on adding it because what about if you had a lot of 4K files that added up to more than 100K should they be included then ? Consider `root/subdir1/ ` inside subdir1 we have a lot of 4K files: ``` dust --min-size 5k 200K root 100K - subdir1 ???? - (Why is nothing here the above directory said there was 100K here?) ```
Author
Owner

@avatar-lavventura commented on GitHub (Aug 8, 2022):

Here they don't have any space as a first line, example output:

$ du -a -d 1 -h
8.0K	./link.py
104K	./bash_scripts
12K	./flask
3.3M	./_utils
4.0K	./cfg_temp.yaml
4.0K	./Pidfile.py
4.0K	./cfg.py
3.7M	./_slurm
4.0K	./start_code.py
28K	./_test
3.7M	./drivers
8.0K	./config.py
4.0K	./env.py

I was considering it for the depth=1 folders ignoring small file sizes

$ dust -H -b -d 1 -n 999999 | tr -d '├──┌─┴' | \
    sed "/0B/d" | sed "/4.0K/d" | sed "/8.0K/d" | sed "/12K/d" | sed "/16K/d" | sed "/20K/d" | \
    sed "/4.1K/d" | sed "/8.2K/d"
<!-- gh-comment-id:1207848884 --> @avatar-lavventura commented on GitHub (Aug 8, 2022): Here they don't have any space as a first line, example output: ```bash $ du -a -d 1 -h 8.0K ./link.py 104K ./bash_scripts 12K ./flask 3.3M ./_utils 4.0K ./cfg_temp.yaml 4.0K ./Pidfile.py 4.0K ./cfg.py 3.7M ./_slurm 4.0K ./start_code.py 28K ./_test 3.7M ./drivers 8.0K ./config.py 4.0K ./env.py ``` ------ I was considering it for the depth=1 folders ignoring small file sizes ``` $ dust -H -b -d 1 -n 999999 | tr -d '├──┌─┴' | \ sed "/0B/d" | sed "/4.0K/d" | sed "/8.0K/d" | sed "/12K/d" | sed "/16K/d" | sed "/20K/d" | \ sed "/4.1K/d" | sed "/8.2K/d" ```
Author
Owner

@bootandy commented on GitHub (Aug 8, 2022):

i think you are the second person to ask for a min-size option, so I'll think about how that could work.

<!-- gh-comment-id:1207992708 --> @bootandy commented on GitHub (Aug 8, 2022): i think you are the second person to ask for a min-size option, so I'll think about how that could work.
Author
Owner

@avatar-lavventura commented on GitHub (Aug 8, 2022):

Ah sorry for asking options. I just wanted something compact as possible I can manage what I want with additional sed :-) Overall dust is pretty nice

<!-- gh-comment-id:1208035148 --> @avatar-lavventura commented on GitHub (Aug 8, 2022): Ah sorry for asking options. I just wanted something compact as possible I can manage what I want with additional `sed` :-) Overall `dust` is pretty nice
Author
Owner

@bootandy commented on GitHub (Aug 23, 2022):

https://github.com/bootandy/dust/pull/252

<!-- gh-comment-id:1223895088 --> @bootandy commented on GitHub (Aug 23, 2022): https://github.com/bootandy/dust/pull/252
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#103