Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

disk-audit

Portable HTML report of stale caches, old IDE versions, and other cruft in your $HOME.

A single Bash script that scans your home directory and produces a self-contained HTML dashboard listing regenerable caches, idle IDE installs, unused Android SDK components, orphan Gradle daemon versions, forgotten build artifacts, and other candidates for cleanup.

It never deletes anything. Every row shows a copy button that puts the exact rm -rf command on your clipboard so you run it yourself.

Features

  • Portable — works on Linux and macOS. Zero non-standard dependencies (bash, du, find, stat, awk).
  • Self-contained output — one HTML file with inline CSS and JS. Works offline. Light and dark themes.
  • Cross-referenced verdicts — instead of just listing sizes, it checks whether things are actually used:
    • Android system-images are matched against your AVD config.ini files
    • NDK versions are matched against build.gradle files in your projects
    • Gradle daemon versions are matched against distributionUrl in every gradle-wrapper.properties in $HOME
    • IDE versions are ranked by last-modified time
  • Safe by design — read-only. No writes, no deletes, no network.

Install

git clone git@github.com:erikgunawan/disk-audit.git ~/disk-audit
ln -s ~/disk-audit/disk-audit ~/bin/disk-audit   # or anywhere on your $PATH

Usage

disk-audit                        # writes ~/disk-audit-YYYY-MM-DD.html
disk-audit /path/to/report.html   # custom output path

xdg-open ~/disk-audit-*.html      # Linux
open ~/disk-audit-*.html          # macOS

What it scans

Section What's in it
Top consumers 25 largest items in $HOME (files and directories, depth 1)
Caches ~/.cache/* (Linux) or ~/Library/Caches/* (macOS)
IDEs Android Studio and JetBrains config + cache dirs, per version
Android SDK system-images/, ndk/, ndk-bundle, and AVDs
Gradle daemon Every version under ~/.gradle/daemon/
Trash ~/.local/share/Trash or ~/.Trash
Large old files Files > 100 MB in ~/Downloads and ~/Desktop not accessed in > 90 days
Project artifacts build/, node_modules/, .gradle/, DerivedData in known project roots
Misc Heap dumps (*.hprof), npm/yarn/pnpm caches, .konan, .docker, Xcode DerivedData

Verdict system

Each row is tagged with one of three verdicts:

  • SAFE — regenerable or confirmed idle (past the stale threshold). Deleting has no operational impact.
  • REVIEW — could be either. Read the note, decide yourself.
  • KEEP — actively used or referenced by a project. Don't delete.

The stale threshold is 30 days. The "large old file" threshold is 100 MB / 90 days. Both are hardcoded near the top of the script — edit STALE_DAYS, OLD_FILE_DAYS, and BIG_FILE_MB to taste.

Safety notes

  • The script does not delete, move, or modify any file. It only reads.
  • Verdicts are heuristics. Nothing replaces a quick manual look before running rm -rf on a large tree.
  • The Android SDK path is picked up from $ANDROID_HOME or $ANDROID_SDK_ROOT, falling back to ~/Android/Sdk.

Why

Disk audit tools like ncdu or dust are excellent for finding large directories, but they don't know that Android Studio 2024.1 is three versions behind your active install, or that a system-image is orphaned because no AVD references it. disk-audit fills that gap by cross-referencing what's on disk with what your projects and IDEs actually use.

License

MIT

About

Portable HTML report of stale caches, old IDE versions, and other cruft in your $HOME.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages