X

Home folder/other files and folders hidden.

There may be times when you have problems with hidden items on your computer. In some cases, various hidden items (mainly folders) may suddenly appear, but other times items that should be visible will have disappeared from the Finder, even though they ar

CNET staff
3 min read

There may be times when you have problems with hidden items on your computer. In some cases, various hidden items (mainly folders) may suddenly appear, but other times items that should be visible will have disappeared from the Finder, even though they are still available through the Terminal and other applications that can see hidden items.

Apple Discussion poster "amarone" writes:

"I have this weird problem on Leopard 10.5.6. In Terminal, I can see my user folder /Users/userfolder. However when I'm in Finder, I can't see "userfolder" under /Users. I've been reading a lot of different solutions but I can't seem to find any solution."

In OS X, you view the items on your hard drive through the Finder, which provides a limited "window" that keeps the system simple, sleek, and clutter-free for most people. There are many hidden files and folders that the system uses to function properly, but Apple has them hidden through the Finder by default. Additionally, most of these files are properly accessible or editable through the Terminal, so having them visible in the Finder is pointless.

When files disappear

When a file or folder has disappeared, it either has become hidden, moved, or deleted. The first thing to do would be to search for it using Spotlight or another search program. If it has not been moved, then the next thing would be to test for whether or not it has been hidden. To do this, locate the enclosing folder for the missing file in the Finder. Then open the Terminal application and type "ls -a" followed by a space. Then drag the enclosing folder from the Finder to the Terminal to complete the path to the folder. Pressing enter will then list the contents of the folder, including hidden items.

If the missing file or folder is present, the next step is to change the Finder flags for the missing item. To do this, use the "chflags" terminal command as follows:

  1. Open the Terminal and type the following:

    chflags nohidden

  2. Ensure there is a space after the command, drag the enclosing folder to the terminal to complete the path, and type a forward slash "/".
  3. At this point you can either complete the path to the file directly by typing the first part of the file name and then pressing the tab key to complete the file name (including name suffix), or just type an asterisk "*" so the command applies to all files in the folder. The asterisk is only recommended if all items in the folder should be viewable.

When hidden files appear

In more common instances people may see normally hidden items suddenly display in the Finder. For the most part these are the hidden "etc," "var," "usr," "bin," and other folders at the root of the hard drive. To hide files, the best approach may depend on the specific situation. For a single file, the best way is to use a terminal command to change the hidden status of a specific file.

1. Using the "chflags" command, you should be able to change the visibility status of a file, as follows:

chflags hidden /path/to/file/

NOTE: To complete the "path/to/file", you can enter the first part of the command followed by a space and then drag the enclosing folder to the Terminal after entering the command, exactly like the previously stated directions.

2. If you have the developer tools installed, you can use the "SetFile" terminal command to change the visibility status of a specific file as well. To do this, use "sudo SetFile -a V" instead of the "chflags hidden" for the command, and complete the path to the file as previously described. For example:

sudo SetFile -a V /path/to/file/

If there are several files or folders that should be hidden, the best way is to set the Finder's "hidden file" settings by entering the following command into the terminal:

defaults write com.apple.finder AppleShowAllFiles FALSE

This command should hide normally hidden items such as the "etc," "var," and other similar folders that might have appeared at the root of the drive.

Resources

  • amarone
  • More from Late-Breakers