Easily hide files or folders from users in the Finder

Jan 06, '10 07:30:00AM

Contributed by: Aikinai

I'm surprised I couldn't find this anywhere on the site yet, but it seems to be the easiest way to hide files or folders from the Finder. This is particularly useful, for example, for hiding a user's Library folder from a less computer-savvy user, as you're afraid they might mess something up in there. To hide a user's Library folder, just type the following code into a Terminal window:

chflags hidden ~/Library
Of course, you can replace the path to the Library folder with any other folder or file you would like to hide. This will only make the folder hidden from the Finder under normal browsing; it can still be accessed through the Terminal or by using the Finder's Go » Go to Folder menu option.

If you want to unhide the Library, type the following code into a Terminal:
chflags nohidden ~/Library
[robg adds: chflags hidden was discussed in this hint about hiding Time Capsule. The other way to hide files and folders is to use SetFile, as explained in this hint. Note that SetFile requires the Xcode Developer Tools be installed.]

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20091229093051878