1.顯示隱藏文件(注意空格和大小寫):
defaults write com.apple.finder AppleShowAllFiles -bool true
或者
defaults write com.apple.finder AppleShowAllFiles YES
2.不顯示隱藏文件:
defaults write com.apple.finder AppleShowAllFiles -bool false
或者
defaults write com.apple.finder AppleShowAllFiles NO
輸入完成後,單擊Enter鍵,然後直接退出終端,重新啓動Finder即可。
重啓Finder:首先強制退出Finder,再重新啓動Finder即可。