How to hide files and folders on Mac

8 min read

Do you start sweating when someone asks if they can borrow your phone? Your entire life is in that phone, of course you don't want anyone to just have access to it. What about a Mac? Not only does it sync lots of your data from iPhone, people often store particularly sensitive or confidential information, often work-related, on their Macs. 

In this guide, we explain how to hide a folder on Mac using both Apple's native tools and some superb third-party software. This will help you avoid a major catastrophe and never let any stranger peek into your private files. 

How to hide folders on Mac

Let's start with the easiest way to hide a file or folder using a keyboard shortcut. The beauty of this method is that you'll use the same shortcut to hide and unhide your files, and the shortcut is Command + Shift + period (.) So whenever you want to hide or reveal a hidden folder, go to Finder and press these three keys. The hidden files and folders will be grayed out. 

a keyboard shortcut to hide a file or folder

Now, let's talk about the cons of this method. 

Command + Shift + period are the keyboard keys anyone can press to unhide your private files, without providing any kind of password to authenticate their identity. And believe us, even a newbie hacker knows this shortcut. So it's not a good way to protect your files. What's more, you'll have to manually go through each file and folder to hide them. 

How to hide all files and folders on your desktop 

People who use your Mac don't necessarily have any intention to spy on you. They just don't have any choice because your private photos and files stored on desktop are catching their eye. By the way, file and folder names can reveal a lot of information you don't want to reveal. 

One Switch is a great tool to keep in your menu bar, so you can can always hide desktop contents with one click. Do this before handing your Mac to other people to make your desktop blank. One Switch also has many other quick actions — keeeping your Mac awake, muting mic, changing screen resolution, and more. You can pick the ones you use often and bring them into the app's menu for quick access. 

Another reason to hide a file on desktop is to be able to take "clean screenshots."  You don't need any desktop icons to be in the background of your screen captures, so it's better to disable them. CleanShot X is a great screen capturing utility with the built-in feature of hiding desktop clutter: 

  1. Open CleanShot X 
  2. In the app's menu bar menu, choose 'Hide Desktop Icons'
  3. Capture screen and save your clean screenshot or screen recording to internal cloud
  4. In CleanShot's menu, choose 'Show Desktop Icons.'

Show Desktop Icons with CleanShot

How to hide folders using Terminal 

If Terminal doesn't intimidate you, you can try the Terminal method of bringing all your sensitive files into one folder and then hiding that folder. It's a bit laborious, but nothing too complicated. Here's how to create a secret folder with Terminal: 

  1. Open Terminal and type the following command: chflags hidden 
  2. Create a new folder with all the files you want to hide on your Mac
  3. Drop the folder onto Terminal 
  4. Press Return. 

That's it, you'll notice that the folder's path will change once you drop it onto Terminal — this is the new path of your hidden folder. To unhide the folder, you can use the same method, just instead of the command above use this one: chflags nohidden.

How to make invisible folders using FileVault 

Provided you don't share your Mac user credentials with anyone, you can secure your files by creating an invisible folder with FileVault. FileVault encodes the information stored on your Mac so it's impossible to see or copy this information without entering your credentials. 

Some people feel sceptical about this method because FileVault encryption can seriously affect your CPU, which will be particularly noticeable on older Macs. Is the speed of your Mac a fair price to pay for FileVault encryption? We don't know. But in case your Mac starts acting slow after you run the encryption, know that FileVault is probably at fault. 

Here's how to make a folder private using FileVault: 

  1. Open System Preferences 
  2. Choose Security & Privacy 
  3. Click the lock to make changes and enter your password
  4. Click Turn On FileVault 
  5. Choose your recovery method and save the changes
  6. Restart your Mac. 

Hide folders in a secret location 

Did you know that your Mac has a secret spot where it tucks away all the files that shouldn't be easy to access? It's the Library folder, of course. Since Apple has been revaming Finder design very actively in the recent years, it might be hard to locate Library via Finder. What's more, there are three different types of a Library folder on Mac, not all of which are hidden by default. To avoid the confusion, we recommend using this tried-and-tested method to access your Library: 

  1. Open Finder
  2. In the Finder menu, choose Go > Got to Folder  
  3. Type the path ~/Library and click Go. 

secret location

In the Library, you can reveal any hidden file and secret folder using the Command + Shift + period (.) shortcut. To move your private files to Library, you should first move them to a separate folder and then drop into Library. Note that you should be keeping track of your Library content, because it's that type of folder that usually eats up a big chunk of the “Other” storage, which is not very easy to clean up. 

Hide files using Apple Developer Tools 

There's another Terminal hack that helps hide and unhide files on Mac. One caveat, though. You need to have Xcode installed on your computer. So you may call it a developer hack. Xcode is a heavy application that eats up lots of space, so we don't recommend installing it just to be able to hide files. If you do use it, however, feel free to make use of this hack: 

  1. Open Terminal and type the following command: setfile -a V (make sure you insert the path of the file you want to hide)
  2. Click Return to run the command
  3. Repeat the above steps with every file.

To unhide files and folders with Xcode, you can use the same command with one exception — lowercase “v.” Here's how the command looks like: setfile -a v

Hide files by adding a dot before file name 

One common trait that all hidden files share is a dot (.) in front of the file name. This means, if you rename your file so it starts with a dot, macOS will automatically treat it as a hidden file: 

  1. Right-click the file
  2. Choose Rename and insert a dot in front of the file name
  3. Confirm you want to make the file invisible
  4. See your file gray out right away.  

create an invisible file using dot in a file's name

Hide files and folders using another account 

If you don't have time to hunt down files and hide them one by one on your Mac, consider a more radical solution — create a dedicated user account where you keep sensitive data. This could be a great workspace split. For example, you might use one of the accounts for private matters and another one for work-related tasks. Here's how to add an account on macOS: 

  1. Open System Preferences > Users & Groups
  2. Click the Lock to make changes and enter your password
  3. Click the plus button and set up your new account. 

create a dedicated user account to keep sensitive data

Unhide folders and files 

As you've noticed, almost each of the methods we described above has some kind of an antidote — a simple method to unhide invisible files and folders. If you're specifically looking for a solution to unhide files on Mac, it's best to use a file manager that can reveal all the hidden files in one spot. Commander One and ForkLift are great options. Let's look into their key capabilities so you can figure out what works best for you. 

ForkLift is a dual pane file manager and an FTP client that comes with a "show hidden files" tool. That's really convenient. You can simply navigate to any disk and folder on your Mac via the Finder-like sidebar in Forklift and then reveal all the hidden files in the select location with one click. 

show hidden files with Forklift file manager

Commander One is a similar dual-pane solution with one small distinction. Unlike ForkLift, where you can only reveal hidden files in one pane at a time, Commander One lets you reveal them in both panes simultaneously so you can spot hidden files across different locations. Use the toggle in the toolbar to show hidden files in both locations. 

show hidden files in files locations

Read the full guide to unhiding files on Mac here. 

Hide a file on Mac with Setapp toolkit, trouble free 

That's how to hide a folder on Mac. You can use tons of different methods, depending on your Mac proficiency and the types of tools you use. One Switch and CleanShot X (tools for hiding desktop files), along with Commander One and ForkLift (tools for showing invisible files) are available for 7 days free with Setapp, so you can try them all out to build the most efficient file-hiding workflow. 

240+ apps for $9.99
per month

Sign up to Setapp and try them for free.