How to reveal dot files in finder? [duplicate]

Solution 1:

Open your Terminal (/Applications/Utilities) then enter,

defaults write com.apple.finder AppleShowAllFiles YES

Then restart Finder by holding down Option and Control, or right-clicking on the Finder's icon in your Dock and choosing "Relaunch".

To revert this behavior, simply change the YES to NO in that defaults command.

Solution 2:

A handy related shortcut to reveal files that begin with a . (dot) in Finder dialogs that popup from a File->Open action is:

Shift + Command + "." 

This toggles "." (dot) files to show/ hide without needing to restart Finder.

You can also define an alias to quickly toggle hidden files within Finder:

alias AllFilesTRUE='defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder'
alias AllFilesFALSE='defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder'