DEV Community

Cover image for Reclaim Your Mac Disk Space
Hamid Shoja
Hamid Shoja

Posted on

Reclaim Your Mac Disk Space

Your Mac is nearly full. That 98% capacity warning is real, and it will start causing build failures, crashes, and slowdowns if you ignore it.

This guide walks through what's eating your disk and exactly how to clean it — fast.


Step 1: Diagnose First

Always start with a full picture before deleting anything.

df -h
Enter fullscreen mode Exit fullscreen mode

Look at the Avail column on /dev/diskXXX. If you see less than 1GB, you're in trouble.

Then find the biggest offenders in your home folder:

du -sh ~/Library/Caches/* 2>/dev/null | sort -rh | head -20
du -sh ~/Library/Application\ Support/* 2>/dev/null | sort -rh | head -20
Enter fullscreen mode Exit fullscreen mode

Step 2: Clear the Caches (Safe, ~N GB+)

~/Library/Caches is safe to delete. Every app rebuilds its cache on next launch but you can pick some specific ones too


Step 3: Tame Application Support

This is where the real weight lives. Unlike Caches, be selective here — some folders contain important app data.

du -sh ~/Library/Application\ Support/* 2>/dev/null | sort -rh | head -25
Enter fullscreen mode Exit fullscreen mode

For may Docker Desktop or Rancher Desktop stores its entire Linux VM + all container images.

If you no longer use Docker just remove it entirly


Step 4: Clean Docker Images

Old branch images from months ago are dead weight. Check what you have:

docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}\t{{.CreatedSince}}"
Enter fullscreen mode Exit fullscreen mode

See how much a full prune would recover:

docker system df
Enter fullscreen mode Exit fullscreen mode

Remove everything not currently running:

docker system prune -a
Enter fullscreen mode Exit fullscreen mode

Or, conservative — only dangling (<none>) images:

docker image prune
Enter fullscreen mode Exit fullscreen mode

Step 5: Verify You Recovered Space

df -h
Enter fullscreen mode Exit fullscreen mode

Check the Avail column again. You should be back to several GBs of free space.


The Developer's Mindset on Disk Hygiene

Disk bloat is gradual. You don't notice until you're at 100% and your docker build silently fails.

A few habits prevent this:

  • Run docker system prune after finishing a feature branch
  • Clear ~/Library/Caches monthly — it's always safe
  • Keep an eye on ~/Library/Application Support/rancher-desktop if you use container runtimes
  • Old branch images in Docker are never coming back — prune them freely

I hope you found it helpful

Top comments (0)