Walks a directory tree and shows a compact, colourised view of disk usage. Shows total size per directory including all children, with human-readable units (KB, MB, GB, TB). Supports depth limiting, size-based sorting, minimum-size filtering, and JSON output. Skips hidden directories by default. Uses os.scandir for performance. Better than du -sh because it shows the full tree structure.
FilesystemUtilityDisk UsageCLI
Features
- Compact tree view with human-readable sizes (KB, MB, GB, TB)
- Depth limiting, size sorting, and minimum-size filtering
- Hidden directory skipping with --all flag
- JSON output for scripting
- Uses os.scandir for sub-second directory traversal
Flags
| Long | Short | Description |
|---|---|---|
| --version | -V | Show version and license |
| --path | -p | Directory to scan (default: current dir) |
| --depth | -d | Max depth (default 3) |
| --sort | -s | Sort by: size (desc) or name |
| --min-size | -m | Minimum size filter (e.g., 10MB) |
| --all | -a | Include hidden directories |
| --json | -j | Output as JSON |
Usage
terminal
$ sizemap
$
$ sizemap --path /var/log --depth 5 --sort size --min-size 100MB
Dependencies
stdlib only — os, sys, stat
Install
$ curl -LO https://labs.stech-sol.com/downloads/sizemap/1.0.0/sizemap_1.0.0.tar.gz
$ tar xzf sizemap_1.0.0.tar.gz
$ chmod +x sizemap/sizemap.py
$ sudo ln -s $PWD/sizemap/sizemap.py /usr/local/bin/sizemap
About
Downloads
Verify integrity
SHA256 checksums