- chronextechnologies
- January 27, 2026
Over time, macOS silently accumulates logs, cache files, temporary data, and developer junk. If you use tools like Docker, VS Code, Chrome, XAMPP, or other dev utilities, this buildup can easily consume tens of gigabytes.
The good news?
You can safely clean most of it β if you know where to look.
This guide shows safe, proven commands to clean macOS without touching critical system files.
First: What You Should NEVER Delete on macOS
Before cleaning, itβs important to know what not to touch.
Never delete these:
-
/System -
/System/Volumes -
/System/Library -
/private/var(entire folder) -
~/Library/Application Support(entire folder)
Deleting these can break macOS or installed apps.
What Is Safe to Clean on macOS
macOS separates system-critical data from temporary and cache data.
The following locations are safe to clean regularly:
| Location | Purpose | Safe |
|---|---|---|
~/Library/Caches |
App caches | |
~/Library/Logs |
App & crash logs | |
/private/tmp |
Temporary system files | |
/private/var/tmp |
Temporary runtime files | |
/private/var/log/*.log |
System logs (truncate only) | |
| Browser caches | Chrome, Edge, Safari | |
| Dev tool caches | VS Code, Docker |
Step-by-Step Safe Cleanup Commands
Before You Start
Close apps like:
-
Chrome
-
VS Code
-
Slack / Teams
-
Docker Desktop
Clear User Cache (100% Safe)
Frees space
Apps recreate cache automatically
Clear Temporary System Files
These are the same files macOS removes during a reboot.
Clean System Logs (Safe Method)
Do not delete log folders β only empty log files.
sudo find /private/var/log –type f -name “*.log” –exec truncate -s 0 {} \;
This keeps permissions intact and avoids system issues.
Clear User Logs
This removes old crash reports and unused app logs.
Clean Browser Cache (Chrome Example)
Chrome will rebuild these automatically.
Clean VS Code Cache (Very Common Space Hog)
Do not delete:
-
extensions -
User/settings.json
Docker Cleanup (Biggest Space Saver)
Docker can silently use 10β30 GB.
docker system prune -a –volumes
This removes:
-
Unused containers
-
Old images
-
Unused volumes
Active containers are not touched.
One-Shot Safe Cleanup (Recommended)
You can safely copy-paste everything below:
# System temp files
sudo rm -rf /private/tmp/*
sudo rm -rf /private/var/tmp/*
# System logs (truncate)
sudo find /private/var/log –type f -name “*.log” –exec truncate -s 0 {} \;
# Chrome cache
rm -rf ~/Library/Application\ Support/Google/Chrome/Default/Cache \
~/Library/Application\ Support/Google/Chrome/Default/Code\ Cache \
~/Library/Application\ Support/Google/Chrome/Default/GPUCache
# VS Code cache
rm -rf ~/Library/Application\ Support/Code/Cache \
~/Library/Application\ Support/Code/CachedData \
~/Library/Application\ Support/Code/User/workspaceStorage \
~/Library/Application\ Support/Code/logs
Restart your Mac after running this.
How Often Should You Clean?
Monthly
Quarterly
-
Run the full cleanup block above
