1. Rebuild the LaunchServices database
Not strictly required, just to be sure it's really up-to-date:
Command for copy & paste into Terminal:
sudo /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
Command broken into multiple lines for better readability:
sudo /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
This is where file associations are stored (which app shall open a file by default) and where all app registrations for files are stored (which apps shall appear in the Open With
menu when you right click a file). Every time you install an app or select a different default app for a file type, this database is updated.
This is a privileged command, only admins can run it and you must type in your password for authorization.
Be patient, this process can take a while and it may hang multiple times for a bit but it will continue, just give it some time.
2. Clear Icon Cache
Only that step is strictly required to fix your issue.
Commands for copy & paste into Terminal:
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
sudo find /private/var/folders/ -name com.apple.iconservices -exec rm -rf {} \;
Commands possibly broken into multiple lines for better readability:
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
sudo find /private/var/folders/ -name com.apple.iconservices -exec rm -rf {} \;
Based on the LaunchServices database, the system generates those files for quicker access to icons.
Those are a privileged command, only admins can run them and you must type in your password for authorization.
3. Restart Dock and Finder
killall Dock
killall Finder
Once those two processes are back up, you should see the correct icons.
Instead of step 3, you can also just reboot your system or log out and back in your user.