2025-08-04 — By Siddharth Jain · 6 min read
Keeping your MacBook clean and fast isn't just about hardware—managing your storage properly is just as important. If you're seeing warnings like "Your disk is almost full," or wondering why your storage is mysteriously consumed by “System Data,” this guide is for you.
Over time, your Mac accumulates a variety of files:
Start with the basics:
Empty Trash
~/Downloads
and delete files you no longer needCaches help apps run faster but can grow too large over time.
rm -rf ~/Library/Caches/*
sudo rm -rf /Library/Caches/*
If you're a developer using Xcode:
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Developer/CoreSimulator
This can save several GBs of space.
Navigate to your Documents
folder and:
rm -rf ~/Library/Application\ Support/MobileSync/Backup/
These backups can take up gigabytes of hidden space.
tmutil listlocalsnapshots /
sudo tmutil deletelocalsnapshots 2025-08-03
Repeat for each snapshot listed. These hidden backups are safe to remove.
sudo rm -rf /private/var/log/*
This frees system-generated logs that aren’t usually needed.
Use tools like:
These apps help visualize or clean up space safely.
Go to:
> System Settings > General > Storage
Enable:
Avoid touching:
/System
and /Library
Create a shell script to automate cleanup:
#!/bin/bash
rm -rf ~/Library/Caches/*
sudo rm -rf /Library/Caches/*
rm -rf ~/Library/Application\ Support/MobileSync/Backup/
rm -rf ~/Library/Developer/Xcode/DerivedData
sudo rm -rf /private/var/log/*
Save as cleanup.sh
and run using:
chmod +x cleanup.sh
./cleanup.sh
After cleaning: