Skip to content

Instantly share code, notes, and snippets.

@ClarkGoble
Last active December 14, 2015 02:49
Show Gist options
  • Save ClarkGoble/5016803 to your computer and use it in GitHub Desktop.
Save ClarkGoble/5016803 to your computer and use it in GitHub Desktop.
#!/bin/bash
# get rid of duplicate apps by reindexing
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -seed -r -domain local -domain system -domain user
# reindex mail
rm $HOME"/Library/Mail/v2/MailData/Envelope Index"
rm $HOME"/Library/Mail/v2/MailData/Envelope Index-shm"
rm $HOME"/Library/Mail/v2/MailData/Envelope Index-wal"
# cleanup downloaded mail attachments (you can always redownload later)
rm -r $HOME"/Library/Mail Downloads/"
# make Library visible
chflags nohidden $HOME/Library
# clean up my Desktop
mv $HOME/"Desktop/*" $HOME"/Documents/Temporary Files/"
# repair permissions
# run diskutil list to get the name of your partitions
diskutil repairPermissions disk4
# clear out caches
rm -r $HOME"/Library/Caches/*"
sudo rm -r /Library/Caches/*
@NeQuissimus
Copy link

Nice script, I forked it and added a few things I had in a similar script of mine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment