A curated collection of battle-tested bash utilities for macOS system management, maintenance, and productivity.
This repository contains practical command-line tools designed to solve common macOS pain points. Each utility is thoroughly documented, safe by default, and built with real-world usage in mind.
Comprehensive, interactive disk space cleaner that safely removes caches and temporary files.
Key Features:
- Cleans 17+ categories (browsers, dev tools, system caches)
- Interactive prompts with dry-run support
- Recovers gigabytes of space safely
- Smart detection for installed tools only
Quick Start:
cleanup --dry-run # Preview cleanup
cleanup --common # Clean typical itemsGracefully terminates Google Drive and all related processes on macOS.
Key Features:
- Graceful shutdown with AppleScript
- Terminates all helper processes and extensions
- Safe fallback mechanisms (SIGTERM → SIGKILL)
- Process verification and reporting
Quick Start:
killgd # Stop Google Drive
killgd && sleep 2 && open -a "Google Drive" # Restart# Clone the repository
git clone https://github.com/LPdsgn/macos-scripts.git ~/bin
# Make scripts executable
chmod +x ~/bin/cleanup/cleanup-disk
chmod +x ~/bin/killgd/kill-google-drive
# Add to PATH (optional - add to ~/.zshrc or ~/.bashrc)
export PATH="$HOME/bin/cleanup:$HOME/bin/killgd:$PATH"Each utility can be installed independently:
# Install only the cleanup tool
cp cleanup/cleanup-disk /usr/local/bin/
chmod +x /usr/local/bin/cleanup-disk
# Install only the Google Drive killer
cp killgd/kill-google-drive /usr/local/bin/
chmod +x /usr/local/bin/kill-google-drive# Kill Google Drive
killgd/kill-google-drive
# Restart it
open -a "Google Drive"
# Or combine both
killgd/kill-google-drive && sleep 2 && open -a "Google Drive"- Clean up Xcode DerivedData and iOS simulators
- Remove Node.js package manager caches (npm, pnpm, yarn)
- Clear Python pip, Rust cargo, Java Maven/Gradle caches
- Reclaim space from Homebrew old versions
- Clean browser caches across all major browsers
- Empty all trash folders (System, iCloud, Google Drive, Dropbox)
- Remove old system logs (30+ days)
- Clear Adobe Creative Suite media caches
- Restart unresponsive Google Drive
- Free up space before major updates
- Regular maintenance automation
- OS: macOS Monterey (12.0) or later
- Shell: Bash 4.0 or higher (pre-installed on macOS)
- Permissions: User-level (no sudo required)
All scripts follow these principles:
- ✅ Safe by Default: Remove only regenerable caches and temporary files
- ✅ User Confirmation: Interactive prompts before destructive operations
- ✅ Dry Run Mode: Preview changes without executing them
- ✅ Graceful Handling: Try gentle methods before forceful ones
- ✅ Clear Reporting: Detailed output with success/failure statistics
- ✅ Process Detection: Check if apps are running before cleanup
- ✅ No Sudo: All operations run with user-level permissions
Contributions are welcome! Here's how you can help:
- Create a new directory for your script
- Follow the established pattern:
- Bash script with clear comments
- Safety features (dry-run, confirmations)
- Comprehensive README.md
- Error handling and reporting
- Test thoroughly on multiple macOS versions
- Submit a pull request
- Add new cleanup targets (disk cleanup)
- Improve error handling
- Add command-line options
- Enhance documentation
- Report bugs or edge cases
- Use
set -euo pipefailfor robust error handling - Implement dry-run mode for destructive operations
- Provide colored, user-friendly output
- Include help text (
--helpflag) - Comment complex logic
- Test on latest macOS versions
MIT License - Feel free to use, modify, and distribute these scripts.
- Built with lessons learned from real-world macOS system administration
- Inspired by the need for safe, reliable command-line tools
- Community feedback and contributions
# Verify PATH includes script directories
echo $PATH
# Add to PATH temporarily
export PATH="$HOME/bin/cleanup:$HOME/bin/killgd:$PATH"
# Add permanently to ~/.zshrc or ~/.bashrc
echo 'export PATH="$HOME/bin/cleanup:$HOME/bin/killgd:$PATH"' >> ~/.zshrc- mas-cli - Mac App Store command line interface
- m-cli - Swiss Army Knife for macOS
- mackup - Keep your application settings in sync
Made with ❤️ for the macOS community
Last updated: January 2026