Skip to content

sizemap

Pythonv1.0.0MIT

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

LongShortDescription
--version-VShow version and license
--path-pDirectory to scan (default: current dir)
--depth-dMax depth (default 3)
--sort-sSort by: size (desc) or name
--min-size-mMinimum size filter (e.g., 10MB)
--all-aInclude hidden directories
--json-jOutput 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
Language
Python
Versionv1.0.0
LicenseMIT
RepositoryGitHub