Md. Minhazul Haque
Minhaz's Blog

Minhaz's Blog

MacOSX Cleanup Script

MacOSX Cleanup Script

Md. Minhazul Haque's photo
Md. Minhazul Haque
·Jun 29, 2015·

1 min read

Recently I had been running out of space on my Mac. Then I downloaded some apps for cleaning up caches and log files. Most of them are premium apps. So I noted down which locations they clean up and used a script to manually remove those files/dirs. ;) Here is what I have been using.

Caution: This might break your system. Use on your own risk.


rm -rf $USER_DIR/Library/Caches/*
rm -rf $USER_DIR/Library/Containers/*
rm -rf $USER_DIR/Library/Developer/Xcode/DerivedData/*
rm -rf $USER_DIR/Library/Logs/*
rm -rf /Library/Caches/Homebrew/*
rm -rf /Library/Logs/*
rm -rf /var/log/*
Share this