Unable to show hidden files on Mac

After you run the defaults write com.apple.finder AppleShowAllFiles YES command, hold the 'option/alt' key, then right click on the Finder icon in the dock and click Relaunch.


Try this:

defaults write com.apple.Finder AppleShowAllFiles -bool true; killall Finder

This sets AppleShowAllFiles to true which tells Finder to show all file. Note the -bool part, that tells will make sure you are setting a Boolean to it instead of string, integer etc. Finally it restarts Finder.