When you’re doing development work on an OS X box and need to shuttle your files to a web server, you’ll notice that the Finder (OS X’s equivalent of Windows Explorer) hides “dot files” like the all-important .htaccess files used by many web applications. You can tell the Finder to show you all files, including all invisible ones, by typing this string into the terminal and pressing return. Case is significant:
defaults write com.apple.Finder AppleShowAllFiles YES
You have to relaunch the finder to make it take effect. There are few ways to do that. One is to choose Force Quit from the Apple menu (or press Command-Option-Esc), select Finder from the list of running applications, and click the Relaunch button (you’ll be asked if you’re sure, requiring you to press a second Relaunch button). Another way is to hold the Option key, then click and hold the Finder icon in the Dock, then choose Relaunch from the context menu. 1
To reverse it, so that you (or your wife, or kid, or pet) don’t accidentally delete something, you repeat the same command, but substitute NO at the end, like this:
defaults write com.apple.Finder AppleShowAllFiles NO
As before, you’ll have to relaunch the Finder for the changes to take effect.
- Still another is to hold down both Control and Option, click the Finder icon in the Dock, and choose Relaunch from the context menu. ↩