Skip to content

alwayspulkit/MacCleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

macOS Cleanup Utility - Pulkit Edition

A lightweight, interactive Zsh shell script designed to reclaim disk space on macOS by purging unnecessary caches, temporary build files, and legacy backups.


πŸš€ Features

  • Interactive Menu: Choose specifically what you want to clean.
  • Developer Focused: Dedicated options for Xcode, Android Studio, and JetBrains/GoLand environments.
  • Browser Maintenance: Clears cache for Chrome, Safari, Firefox, Edge, and Brave.
  • Safety First: Uses setopt nullglob to prevent script errors when folders are already empty.
  • Disk Summary: Displays a quick overview of your storage before you start.

πŸ› οΈ Cleanup Options

Option Target Description
1 User Caches General application caches in ~/Library/Caches.
2 Xcode DerivedData Clears build artifacts and indexes (safe to delete).
3 Xcode Archives Removes old app builds/archives.
4 iOS Backups Deletes local iPhone/iPad backups from MobileSync.
5 Android/Gradle Clears Gradle daemons, caches, and Android Studio build data.
6 Web Browsers Wipes cache for all major browsers.
7 JetBrains/GoLand Clears IDE caches (keeps your settings/configs intact).
8 Trash Empties the user's trash bin.
9 SAFE Summary A "one-click" batch run of options 1, 5, 6, 7, and 8.

πŸ“¦ Installation & Usage

  1. Save the script as mac_cleanup.zsh.
  2. Make it executable:
chmod +x mac_cleanup.zsh
  1. Run the script:
    ./mac_cleanup.zsh
    ```

---

## ⚠️ Requirements

*   **OS:** macOS
*   **Shell:** Zsh (default on macOS Catalina and later)
*   **Permissions:** The script runs in user-space. If you need to delete system-level caches, you may need to run it with `sudo`, though it is currently optimized for user-level data.

---

## πŸ“ Disclaimer

> [!CAUTION]
> This script uses `rm -rf`. While the paths are targeted at cache and temporary directories, ensure you have backups of important data. Specifically, **Option 4** will delete your local iOS device backups. Use with care!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages