Where Did All Your Hard Drive Space Go?
Software development generates significant cache volume. Between Android Studio Gradle wrapper caches, redundant node_modules directories, Docker image layers, and pip wheels, developer SSDs frequently run out of space. Here is how to reclaim 30GB to 80GB safely without breaking your active development environments.
1. Reclaiming Space from Android Gradle Caches (10GB - 30GB)
Gradle caches every historical wrapper JAR and unpacked dependency inside ~/.gradle/caches. Over time, abandoned versions accumulate:
# Stop all running background daemons first
./gradlew --stop
# Delete stale caches (Gradle will re-fetch current project dependencies on demand)
rm -rf ~/.gradle/caches/
rm -rf ~/.gradle/daemon/
# On Windows PowerShell:
Remove-Item -Recurse -Force "$env:USERPROFILE\.gradle\caches"
Remove-Item -Recurse -Force "$env:USERPROFILE\.gradle\daemon"
2. Purging Dormant Docker Layers (15GB - 50GB)
Dangling images, stopped containers, and unused build caches consume substantial disk space:
# Remove all stopped containers, unused networks, and dangling images
docker system prune -a --volumes -f
3. Cleaning Global NPM, Yarn & Pip Caches
# Verify and purge NPM cache
npm cache clean --force
# Yarn cache clean
yarn cache clean
# Pip cache purge
pip cache purge
4. Batch Cleaning Abandoned node_modules and build Folders
Use modern CLI tools like npkill to visually inspect and delete massive node_modules folders across old, archived projects:
npx npkill
This tool scans your selected directory and allows instant deletion of inactive dependency trees with a single keystroke.
Comments (0)
No comments yet. Share your thoughts below!
Leave a Comment
Share your thoughts or questions. Your email address remains private.