Last active
March 17, 2026 23:46
-
-
Save gtchakama/b15ce05bd485a086a8a0526ffd7c3bff to your computer and use it in GitHub Desktop.
macOS Storage Cleanup Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Storage Cleanup Script | |
| echo "π§Ή Starting storage cleanup..." | |
| # 1. Homebrew Cleanup | |
| if command -v brew &> /dev/null; then | |
| echo "πΊ Cleaning up Homebrew..." | |
| brew cleanup -s | |
| rm -rf "$(brew --cache)" | |
| else | |
| echo "β οΈ Homebrew not found, skipping..." | |
| fi | |
| # 2. Clear App Caches (Safe to remove) | |
| echo "π Clearing application caches..." | |
| rm -rf ~/Library/Caches/Google/* | |
| rm -rf ~/Library/Caches/Homebrew/* | |
| rm -rf ~/Library/Caches/com.spotify.client/* | |
| rm -rf ~/Library/Caches/BraveSoftware/* | |
| rm -rf ~/Library/Caches/CocoaPods/* | |
| rm -rf ~/Library/Caches/typescript/* | |
| rm -rf ~/Library/Caches/node-gyp/* | |
| # 3. Clean up Downloads | |
| echo "π₯ Removing disk images from Downloads..." | |
| rm -f ~/Downloads/*.dmg | |
| rm -f ~/Downloads/*.pkg | |
| # 4. System Logs | |
| echo "π Cleaning user logs..." | |
| rm -rf ~/Library/Logs/* | |
| echo "β Cleanup complete! π" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment