Skip to content

Instantly share code, notes, and snippets.

@MariusRumpf
Created July 9, 2019 07:44
Show Gist options
  • Save MariusRumpf/996658315035f40d662a038615e3cdb4 to your computer and use it in GitHub Desktop.
Save MariusRumpf/996658315035f40d662a038615e3cdb4 to your computer and use it in GitHub Desktop.
Clear Mac OS X's icon cache
#!/usr/bin/env bash
# Ask for the administrator password upfront
sudo -v
# Clear icon caches
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
sudo find /private/var/folders/ -name com.apple.iconservices -exec rm {} \;
sudo rm -rf /Library/Caches/com.apple.iconservices.store
# Restart affected applications
for app in "Dock" "Finder" ; do
killall "${app}" &> /dev/null
done
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment