Show all files in the Finder

If you work with Unix files and folders a lot, you’ve probably already noticed that you can’t see many of them in the Finder—the /usr, /bin, and /etc folders, amongst many others, don’t show up in the Finder.

If you want to, for instance, use a GUI editor such as Smultron or BBEdit to open a Unix file, you can’t do it via a double-click (or drag and drop) in the Finder, because those Unix files will be hidden from view. Although most editors, including BBEdit and Smultron, include an “Open Hidden” menu item for reaching these files, sometimes it’s more convenient to browse and open them from the Finder.

Using a simple Terminal command, you can work with all the files on your machine from the Finder. Open Terminal, type this command, and press Enter:

defaults write com.apple.Finder AppleShowAllFiles YES

To make the command take effect, you need to restart the Finder. One way to do this is to hold down the Option key, then click and hold on the Finder icon in the Dock. When the contextual menu appears, select Relaunch and the Finder will restart.

When it does, you’ll find that you can now see every single file and folder on your Mac:


Notice that the /tmp, /usr, and /var directories now show up in the Finder. You’ll also discover that you can see your Unix “dot files,” such as .bashrc, in the Finder.

So what are the downsides of this trick? Well, you’ll see every hidden file on your system, which means that you’ll see a .DS_Store file in every directory. And by having every file visible, it’s that much easier to make a dumb mistake and accidentally delete one (though the truly important files are system-owned, making it much harder to do something stupid to them). Finally, as you can see in the above screenshot, all of your folder icons (in 10.4, at least) will be dimmed. However, if you work with Unix files a lot, you may find these tradeoffs worth it for the increased ease of use.

If you tire of the dimmed folders and other downsides, just open Terminal and repeat the command, but change YES to NO, then press Return again. You’ll need to relaunch the Finder again, but when you do, everything will be back to normal.

Subscribe to the Best of Macworld Newsletter

Comments