hide hidden files mac

Shell
defaults write com.apple.Finder AppleShowAllFiles false
#Change 'false' by 'true' to show hidden files
killall Finder
Source

Also in Shell: