defaults write com.apple.Finder AppleShowAllFiles true [Press Return] killall Finder code example
Example: how to view hidden files in mac terminal
defaults write com.apple.finder AppleShowAllFiles YES
defaults write com.apple.finder AppleShowAllFiles YES