A curated, cross-platform collection of battle-tested command-line utilities for system maintenance, security scanning, and productivity β on macOS (Bash) and Windows (PowerShell/Batch).
This repository (~/.bin) contains practical command-line tools for everyday system maintenance and WordPress security work. Each utility is self-contained, safe by default, and targets the platform(s) it was built for β some are macOS-only, some are Windows-only, and some ship a version for both.
| Utility | Platform | Purpose |
|---|---|---|
| π§Ή Disk Cleanup | macOS + Windows | Interactive cache/temp-file cleaner |
| π Google Drive Killer | macOS | Force-quits stuck Google Drive processes |
| π My IP | Windows | Lists local IPv4 addresses per network interface |
| π§ WP-CLI Wrapper | macOS/Linux + Windows | Portable wp-cli.phar launcher |
| π‘οΈ WP Security Scanner | Cross-platform (PowerShell) | Scans WordPress PHP/JS files for malware patterns |
π§Ή Disk Cleanup Tool
Comprehensive, interactive disk space cleaner that safely removes caches and temporary files. Ships two implementations sharing the same feature set:
cleanup-disk(Bash) β macOS: Xcode DerivedData, browser caches, package manager caches, Homebrew, iOS simulators, Claude Code scratchpads, and morecleanup-disk.ps1(PowerShell 7+) β Windows: same categories adapted for Windows, plus multi-drive selection (-Drive C,D,-Drive All)
Quick Start:
# macOS
cleanup-disk --dry-run # Preview cleanup
cleanup-disk --common # Clean typical items# Windows (pwsh)
.\cleanup-disk.ps1 -DryRun
.\cleanup-disk.ps1 -Common -Drive Cπ Google Drive Killer
Gracefully terminates Google Drive and all related processes on macOS.
Key Features:
- Graceful shutdown with AppleScript, falling back to SIGTERM β SIGKILL
- Terminates all helper processes, crashpad handlers, and Finder extensions
- Process verification and reporting
Quick Start:
killgd # Stop Google Drive
killgd && sleep 2 && open -a "Google Drive" # Restartπ My IP
One-liner PowerShell script that lists every active IPv4 address on the machine, alongside its interface name (loopback excluded).
Quick Start:
.\myip\myip.ps1π§ WP-CLI Wrapper
Portable WP-CLI launcher bundling wp-cli.phar, so wp works from any shell without a separate install:
wpβ Bash wrapper (macOS/Linux, Cygwin-aware path translation)wp.batβ Windows Batch wrapper
Quick Start:
wp --infowp.bat --infoRequires PHP on the PATH.
π‘οΈ WP Security Scanner
PowerShell script that recursively scans WordPress PHP/JS files for common malware and obfuscation patterns (eval, base64_decode chains, unsanitized $_REQUEST usage passed to exec/system, suspicious atob/fromCharCode in JS, etc.), and can export findings to a Markdown report.
Quick Start:
.\wp-scan\wp-scan.ps1 -Path C:\path\to\wordpress# Clone the repository
git clone https://github.com/LPdsgn/macos-scripts.git ~/.bin
# Make Bash scripts executable
chmod +x ~/.bin/cleanup/cleanup-disk ~/.bin/killgd/kill-google-drive
# Add to PATH (~/.zshrc or ~/.bashrc)
export PATH="$HOME/.bin/cleanup:$HOME/.bin/killgd:$HOME/.bin/wp:$PATH"# Clone the repository
git clone https://github.com/LPdsgn/macos-scripts.git $HOME\.bin
# Allow running local scripts (once, per user)
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
# Add to PATH (persist via $PROFILE or System Environment Variables)
$env:PATH += ";$HOME\.bin\cleanup;$HOME\.bin\myip;$HOME\.bin\wp-scan;$HOME\.bin\wp"PowerShell scripts require PowerShell 7+ (pwsh, not the legacy powershell.exe).
- Clean up Xcode DerivedData, iOS simulators, and Claude Code scratchpads (macOS)
- Remove Node.js, pip, Cargo, Maven/Gradle package manager caches (macOS + Windows)
- Manage WordPress installs from the CLI without a global WP-CLI install
- Clean browser caches across all major browsers
- Reclaim space across multiple drives on Windows
- Check local network IPv4 addresses at a glance
- Scan themes and plugins for backdoors, obfuscated code, and suspicious patterns before/after an incident
- Export scan results to a shareable Markdown report
- Restart an unresponsive Google Drive client
- Free up space before major OS updates
- Regular maintenance automation via scheduled tasks / cron
| Tool | Requirement |
|---|---|
cleanup-disk (Bash) |
macOS, Bash 4.0+ |
cleanup-disk.ps1 |
Windows, PowerShell 7.0+ |
kill-google-drive |
macOS, Google Drive for desktop installed |
myip.ps1 |
Windows, PowerShell 7.0+ |
wp / wp.bat |
PHP on PATH |
wp-scan.ps1 |
PowerShell 7.0+ (any OS) |
All scripts run at user-level permissions β no sudo/admin required.
All scripts follow these principles:
- β Safe by Default: Cleanup scripts remove only regenerable caches and temporary files
- β User Confirmation: Interactive prompts before destructive operations
- β
Dry Run Mode: Preview changes without executing them (
--dry-run/-DryRun) - β Graceful Handling: Try gentle methods before forceful ones
- β Clear Reporting: Detailed output with success/failure statistics
- β
Read-Only Scanning:
wp-scanonly reads files and flags patterns β it never modifies or deletes anything - β No Sudo/Admin: 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 and/or PowerShell script with clear comments
- Safety features (dry-run, confirmations) where destructive
- A per-tool README.md
- Error handling and reporting
- Test on the platform(s) you target
- Submit a pull request
- Bash:
set -euo pipefailfor robust error handling - PowerShell:
#Requires -Version 7.0, typedparam()blocks - Implement dry-run mode for destructive operations
- Provide colored, user-friendly output
- Include help text (
--help/-Help)
MIT License - Feel free to use, modify, and distribute these scripts.
Last updated: August 2026