Notes

Show/Hide hidden files in Finder

Edit on GitHub

System Administration

tl;dr

1defaults write com.apple.finder AppleShowAllFiles NO # don't show hidden files
2defaults write com.apple.finder AppleShowAllFiles YES # show hidden files
3
4killall Finder /System/Library/CoreServices/Finder.app # restart Finder
5
6# aliases (showFiles & hideFiles)
7echo "alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES && killall Finder /System/Library/CoreServices/Finder.app'" >> ~/.aliases
8echo "alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO && killall Finder /System/Library/CoreServices/Finder.app'" >> ~/.aliases

Aliases go into where you save them. This could be ~/.bash_profile if you have no idea what aliases are, ~/.zshrc if you’re using Zshell, or ~/.aliases if you’re keeping them in a separate file like me.