Upon re-reading your question after your edit I see you're comfortable with using Terminal, so I've added a second potential solution for this. You do not need to try these in any particular order - try one first and if the issue returns, then try the other. Option 1 sometimes only works temporarily, but Option 2 requires entering commands in Terminal.
Option 1: Reset and restart the Dock
One remedy is to reset and restart the Dock. However, in doing so, you will need to re-add any non-default icons to your Dock. (I usually find it's a good opportunity for people to start afresh and only add things as they actually use them).
So, if your solution doesn't pan out, you can reset and restart the Dock as follows:
- Go to Finder
- Press and hold the option key down
- Now go to the Go menu
- Select the Library option to open the User's Library folder. You can let go of the option key now.
- Go to the Preferences folder (i.e. within the Library folder)
- Find and move the com.apple.dock.plist file to the Trash
- Now open Terminal (usually located in Applications > Utilities)
- Enter this command
killall -KILL Dock
- Press enter
This should resolve the issue - but remember you'll need to re-add some apps back to the Dock.
Option 2: Reset icon cache
If the first solution above doesn't work (or it only works temporarily), you can try resetting the icon cache.
- Launch Terminal (usually found in the Applications > Utilities folder)
- Enter the following three commands, one at a time:
sudo find /private/var/folders/ \ -name com.apple.dock.iconcache -exec rm {} \;
sudo find /private/var/folders/ \ -name com.apple.iconservices -exec rm -rf {} \;
sudo rm -rf /Library/Caches/com.apple.iconservices.store
Let me know how you go.