Mac系统如何显示隐藏文件/文件夹?

沃德普拉斯 发布于 3年前 分类:其他

开发者用Mac系统来工作,从github上down代码,很多隐藏文件在mac默认不显示,mac隐藏文件怎么显示呢?其实很简单,快捷键组合Command+Shift+. 就可以显示隐藏文件、文件夹,再按一次就再次隐藏。

一些朋友反应mac系统升级后,快捷键方式失效了,下面教大家用命令行shell脚本的方式来显示隐藏文件:

show.sh

defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder

hide.sh

defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder

然后在.bash_profile中设置别名:

alias show=/yourpath/show.sh
alias hide=/youpath/hide.sh

source之后可以在终端中通过show和hide来隐藏和显示隐藏文件。

好了,mac隐藏文件怎么显示-mac隐藏文件怎么取消隐藏全部内容就分享到这了,还有问题请在评论探讨!

1个回复

  • ttt5

    终端下执行下面命令

    显示全部文件 
    defaults write com.apple.finder AppleShowAllFiles -bool true osascript -e 'tell application "Finder" to quit'

    不显示全部文件
    defaults write com.apple.finder AppleShowAllFiles -bool false osascript -e 'tell application "Finder" to quit'