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.
Notes:
- Still another is to hold down both Control and Option, click the Finder icon in the Dock, and choose Relaunch from the context menu. ↩
You shouldnt have to hold both ctrl and command. Ctrl alone should do it.
Also, many FTP apps, like the awesome Transmit, have an option to show invisible files. Very handy.
Cyberduck, which I use because I’m cheap, also has that feature, but it only shows you the remote files. So, when you’re dragging and dropping, it helps to be able to see/grab everything.