Sweepfor Mac

Mac maintenance

The Mac Emergency Cleanup (When You Need 5GB Right Now)

Mac is full and you need disk space immediately? This emergency cleanup guide finds 5-30GB in 10 minutes — for when you can't wait for a full audit.

7 min read

You’re trying to install something, or update macOS, or save a file, and the Mac is yelling about disk space. Not in 30 minutes after a thorough audit — right now.

This guide is the order of operations when you need 5GB to keep working in the next 10 minutes. Triage, not perfection.

The quick triage

If you have less than 1GB free, the Mac is unstable. Fix that first:

  1. Quit every app you don’t actively need open. Each running app holds memory and disk space (swap files).
  2. Empty the Trash: Finder → Empty Trash. Or rm -rf ~/.Trash/* in Terminal. This alone often gets you 1-5GB.
  3. Restart the Mac. This clears virtual memory and temporary files. Free space usually jumps 1-3GB.

If you’re now above 5GB, you have time to be more deliberate. If not, keep going.

The fast wins

Plan to spend 5-10 minutes on these. Most of them find space on virtually every Mac.

Downloads folder

Open Finder, go to Downloads. Sort by Size descending. Delete the largest files you don’t need — installers from apps you’ve already installed, old DMGs, ZIPs you’ve extracted, video files, screenshots from a year ago.

If you don’t have time to triage individually:

find ~/Downloads -mtime +30 -delete

That deletes everything older than 30 days. Aggressive, but effective. Often finds 5-20GB.

Trash

Finder → Empty Trash. Don’t skip this even if you “just” emptied it; recently-deleted files in Photos, Mail, and other apps go to a separate trash within those apps.

In Photos: Album → Recently Deleted → Delete All. In Mail: Mailbox → Erase Deleted Items.

Often 1-3GB.

Skip the manual huntSweep finds every cache, log, and forgotten file in seconds. Download Sweep free →

User caches

rm -rf ~/Library/Caches/*

Apps regenerate what they need. Fixes temporary slowdowns sometimes. Usually 2-10GB.

If you’ve used Adobe apps, the cache there is huge:

rm -rf ~/Library/Application\ Support/Adobe/Common/Media\ Cache\ Files/*
rm -rf ~/Library/Caches/Adobe/*

Could be 5-20GB.

Browser caches

rm -rf ~/Library/Caches/com.apple.Safari/*
rm -rf ~/Library/Caches/Google/Chrome/Default/Cache/*
rm -rf ~/Library/Caches/Firefox/Profiles/*/cache2/*

Browsers will be slightly slower for an hour while they rebuild caches. Tolerable. 1-5GB.

Xcode (developers)

If Xcode is installed, this is gold:

rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Developer/Xcode/Archives/*
xcrun simctl delete unavailable

The first one alone often hits 10-30GB. The simulator cleanup is significant if you don’t use older iOS versions.

iOS device backups

ls ~/Library/Application\ Support/MobileSync/Backup/

If there are old backups in there from devices you no longer have or older iPhones, delete them. Each can be 20-50GB.

rm -rf ~/Library/Application\ Support/MobileSync/Backup/[backup-id]

Replace [backup-id] with the actual folder name. Be careful — these are not regenerable for old devices.

The 10-minute deep cuts

If you’ve done the fast wins and still need more:

Photos library “Recently Deleted”

Photos → Album → Recently Deleted → Delete All. Items linger here 30 days otherwise.

Mail downloads

Mail → Settings → Accounts → each account → Account Information. Look for “Download attachments.” Switch to “When read” or “Never.” Then:

rm -rf ~/Library/Containers/com.apple.mail/Data/Library/Mail\ Downloads/*

Mail attachments cached for offline use. Often 2-10GB on heavy email users.

iMessage media

iMessage saves every photo, video, and GIF anyone sent you:

ls -lh ~/Library/Messages/Attachments/

If huge, you can clear old ones. Be careful — this also wipes the in-conversation media display. Better approach: in Messages settings, set “Keep messages: 30 days” so it auto-prunes.

Old iOS simulators

xcrun simctl delete unavailable
xcrun simctl delete --all   # deletes ALL simulators - more aggressive

The second command nukes all simulators; Xcode recreates a default one when you next launch it. Drops 10-30GB.

Spotify or other streaming caches

rm -rf ~/Library/Caches/com.spotify.client/*

Spotify caches songs you’ve played. Often 5-20GB if you’re a heavy user.

Tip: Don't run `sudo rm -rf` on system folders without knowing exactly what you're deleting. The user-level cleanup commands above are safe — anything in `~/Library/Caches/` regenerates. System-level deletes can break macOS.

The 30-second checks

A few quick wins almost everyone has:

Old DMG installers:

find ~/Downloads -name "*.dmg" -delete

Time Machine local snapshots (macOS keeps these on internal SSD when external isn’t connected):

sudo tmutil thinlocalsnapshots / 999999999999 4

This deletes local snapshots, freeing space immediately. Won’t affect external Time Machine backups.

Sleep image (only useful for Power Nap, regenerates):

sudo rm /private/var/vm/sleepimage
sudo touch /private/var/vm/sleepimage
sudo chflags uchg /private/var/vm/sleepimage

The chflags prevents it from being recreated. Frees 8-16GB depending on RAM. Reverse if you want Power Nap back: sudo chflags nouchg /private/var/vm/sleepimage.

The “I have 30 minutes” cleanup

If you’ve bought yourself time with the quick fixes and want to actually solve the problem:

Use Storage Recommendations

System Settings → General → Storage → Recommendations

Real, accurate, often suggests offloading the right things. Click through each and act on what makes sense.

Find genuinely big files

find ~ -type f -size +500M -not -path "*/Library/*" -not -path "*/.Trash/*" 2>/dev/null | xargs -I {} du -h "{}" | sort -rh | head -20

Shows your 20 biggest user files. Some are obvious (a 4K video you forgot, a VM disk). Some are surprising (a database dump, an old video project).

Run a real cleanup tool

A scanner-style cleanup tool finds the rest — app caches in unusual locations, log files that grew without bound, abandoned dependency caches from package managers, old simulator data, Mail downloads, and dozens of similar things that aren’t in any single command above.

For a Mac that’s been used for years without thorough cleanup, an honest scan often finds 30-80GB the manual approach misses.

Free up tens of gigabytesSweep finds the snapshots, caches, and old downloads adding up. Try Sweep free →

What not to do in panic

A few things that look like quick wins but cause more problems:

Don’t delete from /System/: read-only on modern macOS, can’t be deleted anyway. People sometimes try with sudo and break things.

Don’t delete /Library/Frameworks/: system-level frameworks. Apps and the OS depend on them.

Don’t delete ~/Library/Containers/: sandboxed app data. Deleting wipes app preferences and saved state, often files you can’t recover.

Don’t run “free space cleaning” tools you’ve never heard of: bad ones delete things they shouldn’t. Stick to known, reviewed software.

Don’t disable Time Machine to save space: feels like a fix, leaves you without backups when something else goes wrong.

After the emergency

Once you have breathing room, set up the longer-term solution:

  • Schedule weekly cleanup (Calendar trigger or launchd)
  • Configure Photos to optimize storage
  • Set Mail to download attachments only when read
  • Move large project files to external storage
  • Set “Empty Trash automatically after 30 days” in Storage settings

The emergency cleanup is one-time fire-fighting. Without changing habits, you’ll be doing this again in 3 months.

A 60-second emergency template

For the next time, save this:

# Empty Trash + Downloads junk
find ~/Downloads -mtime +30 -delete
find ~/.Trash -mindepth 1 -delete

# Caches
rm -rf ~/Library/Caches/*

# Xcode if installed
rm -rf ~/Library/Developer/Xcode/DerivedData/* 2>/dev/null
rm -rf ~/Library/Developer/Xcode/Archives/* 2>/dev/null

# Time Machine local snapshots
sudo tmutil thinlocalsnapshots / 999999999999 4

echo "Emergency cleanup done. Free space:"
df -h /

Save as ~/bin/emergency-cleanup.sh, chmod +x. Run when needed. Usually buys 10-40GB of breathing room in under a minute.

← Back to all guides