Here are few steps I used to free some space on my MacOS 26.0.1 . I had to clean up temporary and unused files on macOS from the terminal. You need to be careful to not delete system-critical stuff. I got more then 25GB of free space after. Here are safe console approaches:
πΉ 1. Clear system & app caches
rm -rf ~/Library/Caches/*
sudo rm -rf /Library/Caches/*
(will remove user and system caches β apps may rebuild them on next launch)
πΉ 2. Remove old logs
sudo rm -rf /var/log/*
rm -rf ~/Library/Logs/*
πΉ 3. Delete temporary files
sudo rm -rf /private/var/tmp/*
sudo rm -rf /private/tmp/*
πΉ 4. Clear user Trash
rm -rf ~/.Trash/*
πΉ 5. Find big unused files (interactive cleanup)
To locate large files:
sudo du -h -d 2 / | sort -h | tail -n 20
Or for your home folder only:
du -h -d 2 ~ | sort -h | tail -n 20
πΉ 6. Clean old Xcode junk (if you do iOS/macOS dev)
Xcode eats a lot of space:
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Developer/Xcode/Archives/*
rm -rf ~/Library/Developer/Xcode/iOS DeviceSupport/*
πΉ 7. Use built-in macOS purge command
macOS also has:
sudo purge
This frees up inactive memory (RAM swap) but not disk.
β
Tip: If you want a one-liner that cleans caches, logs, tmp, trash, and Xcode leftovers safely, you can run:
rm -rf ~/Library/Caches/* ~/Library/Logs/* ~/.Trash/* \
&& sudo rm -rf /Library/Caches/* /var/log/* /private/var/tmp/* /private/tmp/* \
&& rm -rf ~/Library/Developer/Xcode/DerivedData/* ~/Library/Developer/Xcode/Archives/*
β οΈ Important:
- Always double-check before rm -rf!
- Donβt run cleanup commands on /System or /Library beyond caches/logs.
- After cleaning, a restart is often good.