表示に切り替える場合
defaults write com.apple.finder AppleShowAllFiles TRUE
非表示に切り替える場合
defaults write com.apple.finder AppleShowAllFiles FALSE
以下のコマンドを実行して、Finderを再起動させる。
killall Finder
リファレンス
Netafull
defaults write com.apple.finder AppleShowAllFiles TRUE
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder