MAC OS X - Showing hidden files in Finder

by 5. March 2011 00:00

If we do a directory list "ls -l" we'll find that it displays the same contents as the Finder.

If we do a directly listing using "ls -al" then we get different results - it also shows hidden files (prefixed with a period - see above).

 Under your home directory you will have a library/preferences folder, from the terminal you can type in "cd library/preferences" to get to it.  This folder holds the configuration options for the various applications.   We are interested in the com.apple.finder.plist configuration file.

You can use the "defaults write" command to programmatically set values in this file; in my case the file didn't exist so I found by executing the following - it created it:

defaults write com.apple.finder AppleShowAllFiles -bool true

Likewise you can disable it by setting -bool false.   Once the file exist you can easily update the AppleShowAllFiles configuration, as well as others, using the open command, e.g.,

open library/preferences/com.apple.finder.plist  (as shown below)

In order for this change to take affect the Finder must be restarted.  To do this simply hit the Command-Option-ESC key, select the Finder, and click the relaunch button.  You'll find that when you click on Finder that you will be able to see all files to include hidden ones.

Tags:

Mac X

Notice

Blog videos and references to CodePlex projects are no longer valid