CleanUpMac
Bash script to clean your macOS computer.
Install / Use
/learn @paulaime/CleanUpMacREADME
CleanUpMac
Bash script to clean your macOS computer.
# Maintenance script for macOS
#!/usr/bin/env bash
# Ask for the administrator password upfront
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit
fi
echo 'Empty the Trash on all mounted volumes and the main HDD…'
sudo rm -rfv /Volumes/*/.Trashes &>/dev/null
sudo rm -rfv ~/.Trash &>/dev/null
echo 'Clear System Log Files…'
sudo rm -rfv /private/var/log/asl/*.asl &>/dev/null
sudo rm -rfv /Library/Logs/DiagnosticReports/* &>/dev/null
sudo rm -rfv /Library/Logs/Adobe/* &>/dev/null
rm -rfv ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail/* &>/dev/null
rm -rfv ~/Library/Logs/CoreSimulator/* &>/dev/null
echo 'Clear Adobe Cache Files…'
sudo rm -rfv ~/Library/Application\ Support/Adobe/Common/Media\ Cache\ Files/* &>/dev/null
echo 'Cleanup iOS Applications…'
rm -rfv ~/Music/iTunes/iTunes\ Media/Mobile\ Applications/* &>/dev/null
echo 'Remove iOS Device Backups…'
rm -rfv ~/Library/Application\ Support/MobileSync/Backup/* &>/dev/null
echo 'Cleanup XCode Derived Data and Archives…'
rm -rfv ~/Library/Developer/Xcode/DerivedData/* &>/dev/null
rm -rfv ~/Library/Developer/Xcode/Archives/* &>/dev/null
echo 'Cleanup Homebrew Cache…'
brew cleanup --force -s &>/dev/null
brew cask cleanup &>/dev/null
rm -rfv /Library/Caches/Homebrew/* &>/dev/null
brew tap --repair &>/dev/null
echo 'Cleanup any old versions of gems…'
gem cleanup &>/dev/null
echo 'Running the maintenance scripts…'
sudo periodic daily weekly monthly
echo 'Purge inactive memory…'
sudo purge
clear && echo 'Yeah, everything is cleaned up! :)'
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
View on GitHub75/100
Security Score
Audited on Jan 5, 2026
No findings
