keepcalculator

06 Numbers and Powers

Hide Files and Folders on Mac: 5 Ways

Card No. 06·23132 · Updated · Standard formula, shown below

To hide files and folders on a Mac, you can use the built-in `chflags hidden` command in Terminal, which makes items invisible in Finder, or you can use third-party apps for more advanced protection. This guide covers the built-in methods, how to unhide items, and the limitations of each approach.

Why Hide Files and Folders on a Mac?

People hide files for a variety of reasons, from decluttering a busy desktop to keeping sensitive documents out of casual view. The most common use cases are:

  • Privacy: Hiding personal documents, financial records, or a private folder that you don’t want others to see when they borrow your Mac.
  • Organization: Hiding system or support files that clutter your home folder, or hiding rarely used files to keep Finder clean.
  • Preventing Accidental Deletion: Making a file invisible can reduce the chance of you or someone else accidentally moving or deleting it.

It’s important to note that hiding a file on a Mac is not the same as encrypting it. Hiding only removes it from view in Finder; anyone who knows the path can still open it, and a quick Terminal command can reveal all hidden files. For real security, you should use FileVault (full-disk encryption) or a password-protected encrypted disk image.

Method 1: Using Terminal (chflags)

The most direct and built-in way to hide a file or folder is with the chflags command in Terminal. This method works on any file or folder and is reversible in seconds.

  1. Open Terminal (found in Applications > Utilities).
  2. Type chflags hidden followed by a space.
  3. Drag the file or folder from Finder into the Terminal window. This will fill in the path automatically.
  4. Press Return. The item will disappear from Finder immediately.

To unhide the item, use the same command but replace hidden with nohidden:

chflags nohidden /path/to/file

Method 2: Using Finder’s “Hide” Option (macOS Ventura and later)

Starting with macOS Ventura, Apple added a simpler, built-in way to hide files and folders directly in Finder, without needing Terminal. This is the most user-friendly method for most people.

  1. Control-click (or right-click) the file or folder you want to hide.
  2. Select “Hide [item name]” from the context menu.
  3. The item will be moved to a hidden state and will no longer appear in its original location.

To unhide it, you need to use Finder’s Go to Folder feature (see below) to navigate to the item’s location, then Control-click it and select “Show [item name]”.

Method 3: Using the “Go to Folder” Shortcut to Access Hidden Items

Once you’ve hidden a file or folder, you may need to access it again. The easiest way is to use Finder’s Go to Folder command, which lets you type the full path to any location, even if it’s hidden.

  1. In Finder, press Command + Shift + G (or click Go > Go to Folder in the menu bar).
  2. Type the full path to the hidden item. For example, if you hid a folder called “Private” in your home folder, you would type ~/Private.
  3. Press Return. The folder will open in Finder, even though it’s hidden.

You can also use this method to unhide an item using Terminal: navigate to the parent folder with cd, then run chflags nohidden on the item.

Method 4: Show All Hidden Files in Finder (Temporary)

If you want to see all hidden files on your Mac at once—including the ones hidden by the system—you can use a Terminal command to toggle the visibility of hidden files in Finder.

  1. Open Terminal.
  2. Type the following command and press Return:
defaults write com.apple.finder AppleShowAllFiles -bool true
  1. Restart Finder by typing killall Finder and pressing Return.

To hide them again, replace true with false and restart Finder again. This method is useful for troubleshooting or when you need to see a hidden file but don’t want to unhide it permanently.

Method 5: Using Third-Party Apps for Extra Protection

If you need password protection or encryption, built-in methods won’t suffice. Third-party apps like Hider 2 or Secret Folder offer a friendly interface to hide and password-protect files. These apps typically work by moving your files into an encrypted container or by setting special flags. They are not free, but they provide a more user-friendly experience for non-technical users.

For a free, more secure alternative, you can create an encrypted disk image using Disk Utility. This gives you a password-protected, encrypted container that you can mount when needed.

Common Problems and How to Solve Them

  • I can’t see a hidden file even with “Go to Folder”: Make sure you typed the path correctly. If the file is in your home folder, use ~ to represent it. Also, check if you have a space in the file name; you may need to escape it with a backslash (\ ) in Terminal.
  • I hid a file and now I can’t find it anywhere: Use the “Go to Folder” method to navigate to the known location. If you don’t know the exact path, you can use Spotlight (Command + Space) and type the file name; it will still appear in search results even if hidden.
  • The “Hide” option is grayed out in Finder: This option is only available for items you own and have permission to modify. If the item is in a system location or belongs to another user, you won’t see the option. Use Terminal instead.
  • Hidden files keep reappearing after restart: This can happen if you used the defaults write command and didn’t set it back to false. Check the setting again and restart Finder.

Frequently Asked Questions

Can I hide files without using Terminal?

Yes, on macOS Ventura or later, you can Control-click a file and choose “Hide”. For older macOS versions, you’ll need to use Terminal or a third-party app.

Are hidden files still searchable with Spotlight?

Yes, Spotlight can still find hidden files. If you want to exclude a file from Spotlight, you need to add its folder to the Privacy tab in System Settings > Spotlight.

How do I unhide a file that I hid with the Finder “Hide” option?

Use Go to Folder (Command + Shift + G) to navigate to the file’s location, then Control-click it and select “Show [item name]”.

Is hiding a file the same as encrypting it?

No. Hiding only makes it invisible in Finder. Anyone with technical knowledge can still access it. For true security, use FileVault or create an encrypted disk image.

Can I hide files on an external drive?

Yes, the chflags method works on any drive that uses a Mac-compatible file system (APFS, HFS+, etc.). The Finder “Hide” option also works on external drives.

What is the difference between “hidden” and “invisible” files on Mac?

They are the same thing. On macOS, hidden files are those with the hidden flag set, which makes them invisible in Finder. The system itself also has hidden files (starting with a dot) that are hidden by default.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →