How to clear caches on a Mac safely
Caches are files apps keep so they start faster, and clearing the inside of a single app’s cache folder is safe. Quit the app first, then clear one app at a time. Do not select everything in the Caches folder and delete it. The worst outcome of clearing a real cache is that the app is slower once while it rebuilds.
Check the size first
du -sh ~/Library/Caches
du -sh ~/Library/Logs
On the Mac used for the blog post, Caches was 43 GB, about two thirds of its Library folder, and Logs was 81 MB. Yours will differ. To see which app folders are largest:
du -sh ~/Library/Caches/* 2>/dev/null | sort -h | tail -10
Clear one app
- Quit the app.
- In Finder, choose Go, hold Option, and open Library. Open Caches.
- Open the folder for that app and drag its contents to the Trash.
- Open the app. It rebuilds what it needs.
Move to the Trash rather than deleting, so you can put it back. Wait a day, then empty the Trash.
What to leave alone
- The top level of your Library folder. Never delete whole folders like Application Support, Preferences or Containers.
- Anything you cannot name. Search its name first. If that does not make it clear, leave it.
- System folders. macOS owns them.
Some apps keep state in their cache folder that is not really a cache, which is why you go one app at a time.
Other safe places from the same list
Logs are text files and safe to clear. Xcode DerivedData is safe if you build apps, and the next build is a full build. Homebrew has a dry run, brew cleanup -n, that shows what it would remove before you run it for real.
A restart helps too
Restarting the Mac empties several system caches on its own. Apple adds that starting in Safe Mode clears certain system caches and can free space for something like an update. Restart normally to leave it.
Where it fits
If the number you want to shrink is System Data, read what System Data is. NotchStar’s Disk tool scans caches, logs and Xcode build data and lets you pick what to move to the Trash.