Skip to content

Instantly share code, notes, and snippets.

@johnjreiser
Created January 6, 2026 22:35
Show Gist options
  • Select an option

  • Save johnjreiser/bbf7ee047db2ce31639d82ac685cf918 to your computer and use it in GitHub Desktop.

Select an option

Save johnjreiser/bbf7ee047db2ce31639d82ac685cf918 to your computer and use it in GitHub Desktop.
cleanup.sh - remove common caches and large files on macOS
#/bin/bash
set -e
echo Cleaning up Python pip cache...
pip cache purge
echo Cleaning up Node.js npm cache...
npm cache clean --force
echo Cleaning up Docker data...
docker system prune -f
docker scout cache prune --sboms
echo Cleaning up Homebrew data...
brew cleanup
echo Cleaning up Apple Mail logs...
APPLE_MAIL_LOG_DIR=~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail
ls ${APPLE_MAIL_LOG_DIR}/*.txt
rm -f ${APPLE_MAIL_LOG_DIR}/*.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment