How to Hide Files and Folders on Mac

In this tutorial you will learn how to hide files and folders on Mac.
When you have to share your Mac with someone else, chances are that you don’t want him or her to have free access to all of your files. Since you cannot always create a new account for each guest user, here’s how to hide files and folders that you don’t want others to see.
Let’s say, we want to hide the invoice PDF file. What to do?


Step 1. In your Finder menu, click “Go”, “Utilities” and choose “Terminal”.

opening „Terminal” window on a Mac

Step 2. Terminal will open a new command window. In this window, type the following command that will hide your file: “chf lags hidden” and a single space.

typing the „chf lags hidden” command followed by a single space in Terminal window on a Mac

Step 3. Now drag the file that you want to hide to the Terminal window. The name of the file will be added to the command.

dragging the file to the Terminal window on a Mac

Step 4. Click the “Return” key: that will activate the file adding command.
Step 5. Just in the same way you can hide a folder: watch how we hide the folder with our personal photos.
Here you go! Our Mac is ready for guest browsing.

hiding a folder on a Mac

Step 6. When you’re back to working on your Mac, you’ll probably want to unhide your files and folders. To do that, open up the Terminal window again and, while being inside the window, press the “UP” arrow key. That will reveal the last command performed by Terminal.

revealing the last command performed by Terminal

Step 7. Use the arrow key to reach the word “hidden” inside the command and change it to “nohidden”.Press “Return” key to unhide the file or folder.

changing the word „hidden” inside the command to „nohidden”

Step 8. If you need to hide a lot of files and folders from time to time, we suggest you create a special “hidden” folder where you temporary transfer all of them.
Result: You’ve just learned how to hide and keep secret files and folders on your Mac.