tree-pro is a lightweight alternative to tree, providing clean directory trees with folded duplicates and file limits.
Option A — via go install (recommended):
go install github.com/Djanghao/[email protected]
# or use the latest tag
go install github.com/Djanghao/tree-pro@latestMake sure $(go env GOPATH)/bin is on your PATH (or set GOBIN):
echo 'export PATH="$(go env GOPATH)/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcOption B — build from source after cloning:
git clone https://github.com/Djanghao/tree-pro
cd tree-pro
# install to your Go bin (no sudo required)
go install .
# or build a local binary
go build -o tree-pro .tree-pro [path] [flags]-f, --fileslimit files per directory (default 5)-d, --dirsexpand identical directories (default 1)-L, --levelmax depth (0 = unlimited)
Example:
tree-pro -f 2 -d 1 /path/to/your/project