Need to hide a folder or two on a Mac? A while back we showed you how to make invisible folders and to even how to make hidden folders in Mac OS X, but now we’re going to demonstrate how to turn an existing folder into a hidden folder.



How to Hide Folders in Mac OS X

Hiding existing folders is fairly easy:

Launch the Terminal, found in /Applications/Utilities/ or from Launchpad

Type the following command:

chflags hidden /path/to/folder/ When finished, close out of Terminal

For example, to hide a folder in my home directory named “Secrets” the command would be:

chflags hidden ~/Secrets/

The folder will immediately disappear from visibility, becoming hidden from the Finder. This includes everything contained within the folder as well, whether they are more files or other folders.

If you want to truly hide the folder and it’s contents, take an extra step and exclude the folder from Spotlight indexing. This makes sure that none of the files inside of it can be found through the Spotlight search feature in OS X.

While this hides folders from being visible in the GUI and will keep 95% of users unaware of the folders existence, keep in mind that practically anything is visible from the command line, and if an advanced user was keen or determined enough, they could probably track down the folder or its contents.

Access the Hidden Folders in Mac OS X

Now that the folder is hidden, here is how to access it:

From the Mac OS X desktop, hit Command+Shift+G to bring up the “Go To Folder” window

to bring up the “Go To Folder” window Enter the same path to the folder as you used when hiding it:

You’ll now be inside the hidden folder, able to open, copy, move, and use the contained files and folders as usual.

Unhiding the Folder in Mac OS X

If you no longer want the folder to be hidden anymore, here’s what to do:

As before, launch the Terminal application

Enter the following command:

chflags nohidden /path/to/folder/ Close the Terminal

As an example, to unhide a folder on the users desktop named “Secret Folder” the command would be:

chflags nohidden ~/Desktop/Secret Folder/

Again, the folder will become immediately visible to the desktop. If you blocked the contents from Spotlight, you may want to remove it from there as well to be able to find and locate as usual.

If you read OSXDaily with any regularity, some of this will be familiar to you for good reason. The chflags nohidden command is the same thing we use to show the Library directory in OS X Lion, and accessing the folder once it is hidden is done the same way we access the user Library folder when it’s hidden as well.