让 Finder 显示隐藏文件和文件夹
$ defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder
$ defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder
创建终端快捷命令
在 zsh shell 下,创建快捷命令
$ echo "alias fd='defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder'">> ~/.zshrc && source ~/.zshrc
$ echo "alias fd='defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder'">> ~/.zshrc && source ~/.zshrc
使用方法
显示隐藏文件
$ fd
隐藏文件
$ fh