Last active
September 27, 2019 16:58
-
-
Save askucher/f21f62c226d017fb8905e7cd5dcfe12b to your computer and use it in GitHub Desktop.
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
#Taking out the trash. | |
printf "Emptying the trash.\n" | |
sudo rm -rfv /Volumes/*/.Trashes > /dev/null 2>&1 | |
sudo rm -rfv ~/.Trash > /dev/null 2>&1 | |
sudo rm -rfv ~/Library/Logs > /dev/null 2>&1 | |
#Clean the logs. | |
printf "Emptying the system log files.\n" | |
sudo rm -rfv /private/var/log/* > /dev/null 2>&1 | |
sudo rm -rfv /Library/Logs/DiagnosticReports/* > /dev/null 2>&1 | |
#Cleaning Up Homebrew. | |
printf "Cleaning up Homebrew.\n" | |
brew cleanup --force -s > /dev/null 2>&1 | |
brew cask cleanup > /dev/null 2>&1 | |
rm -rfv /Library/Caches/Homebrew/* > /dev/null 2>&1 | |
brew tap --repair > /dev/null 2>&1 | |
brew update > /dev/null 2>&1 | |
brew upgrade > /dev/null 2>&1 | |
#Purging Memory. | |
printf "Purging memory.\n" | |
sudo purge > /dev/null 2>&1 | |
#Securly Erasing Data. | |
printf "Securely erasing free space (This will take a while). \n" | |
diskutil secureErase freespace 0 "$( df -h / | tail -n 1 | awk '{print $1}')" > /dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment