Disk Tree is a CLI that displays the file size according to the directory structure,
like the tree
command.
Install using homebrew:
brew install xkumiyu/tap/disktree
If you want to use the HEAD, you can do the following:
go get github.com/xkumiyu/disktree/cmd/dtree
You can use dtree
command.
dtree [OPTIONS] PATH
-L, --max-depth INT
: show only to max-depth-s, --sort STRING
: select sort: name(default), size, and files--min-size STRING
: show only files/dirs larger than min-size--color STRING
: set the colorization: auto(default), always, and never
dtree -L 2 -s size -min-size 1M ~/
The processing time when running in a large directory (>1M files) is as follows:
command | time |
---|---|
dtree | 45.6s +/- 4.8s |
tree -a -s | 117.2s +/- 3.8s |