Hidden Files and Directories

From Mac OS X Server FAQ

Jump to: navigation, search

Files or folders will be hidden from the Finder under the following cirumstances:


The file or folder has a name that begins with a period. This is a unix convention, and is used commonly by unix applications to store preference files (sometimes called dotfiles) within a user's home directory.

The file or folder is at the root level of the boot drive, and is listed in the file /.hidden. To see the full list of items hidden in this way, issue the command

cat /.hidden

Note that this is a Finder trick, and only applies to the root level of the current startup volume. Also note that the items var, tmp, etc, and mach are symbolic links (symlinks) and would not be visible by simply removing their names from the .hidden file (but you probably do not want them visible in the Finder anyway).

The file or folder has its invisibility bit set to true. This can be examined using the developer tool GetFileInfo, and manipulated with SetFile. If you don't have the developer tools installed, these two commands are unavailable.

/Developer/Tools/GetFileInfo blarg
file: "blarg"
type: ""
creator: ""
attributes: aVbstclinmed
created: 12/20/2004 16:14:00
modified: 12/20/2004 16:14:00

The list of attributes shows that the invisible bit (V) is set to true. Each attribute is represented by a letter, and each has two values: on or off. If the letter is lowercase, the attribute is off or unset. If uppercase, the attribute is on.

To make the file visible again, use SetFile

/Developer/Tools/SetFile -a v blarg

now GetFileInfo shows:

file: "blarg"
type: ""
creator: ""
attributes: avbstclinmed
created: 12/20/2004 16:14:00
modified: 12/20/2004 16:14:00

Note: Changes made with SetFile are generally not visible until Finder is restarted; you can do this by executing killall Finder in a terminal.

References

See also Hide files Mac

Personal tools
Toolbox