![crate.badge] ![license.badge] ![commits.badge]
Linux: ![linux.build.badge] Windows: ![windows.build.badge]
treesize
is a small command-line utility for listing a directory tree sorted by size. It's main goal is to quickly provide an overview of what is taking up the most space in a tree, so by default it will only list the 5 largest entries in the specified directory (and summarize the rest):
```
treesize . 201.5 MB (Σ) ├── target 201.5 MB (Σ) ├── src 8.6 KB (Σ) ├── Cargo.lock 4.7 KB ├── appveyorrustinstall.ps1 2.7 KB ├── README.md 2.1 KB └── ... 2.4 KB (Σ) ```
You can use these options to tweak the output listing (traversal of the tree is not affected):
-d <max-depth> Maximal directory depth to recurse, or -1 for infinite [default: 0]
-e <max-entries> Maximum number of entries to display per directory, or -1 for infinite [default: 5]
For example:
```
treesize -d2 -e3 . 201.5 MB (Σ) ├── target 201.5 MB (Σ) │ ├── debug 137.5 MB (Σ) │ │ ├── deps 131.6 MB (Σ) │ │ ├── treesize.exe 3.1 MB │ │ ├── build 2.8 MB (Σ) │ │ └── ... 260 B (Σ) │ └── release 64.0 MB (Σ) │ ├── deps 60.7 MB (Σ) │ ├── build 2.5 MB (Σ) │ ├── treesize.exe 800.0 KB │ └── ... 262 B (Σ) ├── src 8.6 KB (Σ) │ ├── directory 6.1 KB (Σ) │ │ ├── print.rs 2.5 KB │ │ ├── mod.rs 2.4 KB │ │ └── tree.rs 1.2 KB │ └── main.rs 2.5 KB ├── Cargo.lock 4.7 KB └── ... 7.2 KB (Σ) ```
Dot-files and symlinks are ignored unless you use these flags:
-a List all files (including dotfiles)
-L Follow any symbolic links encountered