Hide or show hidden files quickly in OSX

How to setup some quick shortcuts to toggle visibility of hidden files in Finder

  • In Terminal type: sudo nano ~/.bash_profile
  • Append to the file the following: alias showFiles=’defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app’
  • In a new line type: alias hideFiles=’defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app’
  • Save the file
  • To make the aliases available in Terminal type: source ~/.bash_profile

Now you have two additional commands: showFiles and hideFiles to make things easier.