Created
May 28, 2016 21:08
-
-
Save anthonygelibert/581d007f1cdb7ea5c435476687dc9454 to your computer and use it in GitHub Desktop.
Clean all the temporary files in my OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
cd /var/log | |
# Clean all the old logs | |
rm -v **/*.bz2 | |
rm -v **/*.gz | |
rm -v **/*.log.[0-9] | |
TODAY="$(date "+%Y.%m.%d")" | |
TODAY2="$(date "+%Y%m%d")" | |
cd /var/log/asl | |
rm -vr $(ls | grep -v "$TODAY" | grep -v "$TODAY2"| xargs) | |
cd /var/log/DiagnosticMessages | |
rm -vr $(ls | grep -v "$TODAY" | grep -v "$TODAY2"| xargs) | |
cd /var/log/powermanagement | |
rm -vr $(ls | grep -v "$TODAY" | grep -v "$TODAY2"| xargs) | |
rm -rv /Library/Logs/DiagnosticReports/* | |
rm -rv /Library/Logs/CrashReporter/* | |
rm -rv /Library/Logs/VMware/*.log | |
rm -rv /Library/Application\ Support/CrashReporter/* | |
rm -v /Library/Logs/SleepWakeDebug/fullwake-spindump.txt | |
rm -v /tmp/logs/wifi-* | |
rm -v /tmp/logs/yjp* | |
rm -v /var/log/Accounts/*.gz | |
rm -v /var/log/module/**/*.gz | |
rm -v /Users/tony/Library/Group\ Containers/UBF8T346G9.Office/MicrosoftShipAssertLog_*.txt | |
cd $HOME | |
rm -v .bash_history | |
rm -vr .oracle_jre_usage | |
rm -vr .yjp | |
rm -v .vim/tmp/* | |
rm -v Library/Application\ Support/DEVONthink\ Pro\ 2/Console.log | |
rm -rv Library/Application\ Support/CrashReporter/* | |
rm -rv Library/Application\ Support/Firefox/Crash\ Reports/* | |
rm -vr Library/Developer/Xcode/DerivedData/* | |
rm -vr Library/Containers/com.apple.mail/Data/Library/Logs/Mail/* | |
rm -vr Library/Containers/com.apple.mail/Data/Library/Mail\ Downloads/* | |
rm -v Library/Containers/2BUA8C4S2C.com.agilebits.onepassword-osx-helper/Data/Library/Backups/*_zip | |
rm -rv Library/Logs/DiagnosticReports/* | |
rm -rv Library/Logs/IntelliJIdea2016.1/* | |
rm -rv Library/Logs/Focus/*.log | |
rm -rv Library/Logs/VMware\ Fusion/*-[0-9].log | |
rm -v Library/Logs/talagent.log.[0-9] | |
rm -rv Library/Logs/CrashReporter/MobileDevice/iPad\ Pro/* | |
rm -rv Library/Logs/CrashReporter/MobileDevice/iPhone\ Pro/* | |
rm -rv **/.Sparkle/* | |
rm -rv **/.Sparkle/.* | |
rm -v **/.DS_Store | |
rm -v **/\~\$* | |
cleanSQLiteDB.sh . | |
cd /Library/ | |
cleanSQLiteDB.sh . | |
cd /Applications | |
cleanSQLiteDB.sh . | |
cd $HOME/Documents | |
rm -vr *.dtBase2/Backup* | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment