Yes, you can hide folders on a Mac using Terminal commands, the Finder’s hidden attribute, or third-party apps. The quickest built-in method is running chflags hidden in Terminal, which makes a folder invisible in Finder while keeping it fully accessible. Below are the exact steps for every built-in approach, plus what to do when hidden folders won’t stay hidden.
Why Hide a Folder on Mac?
Hiding folders on macOS serves two main purposes: decluttering and privacy. You might want to hide a folder full of screenshots from your desktop, keep a work project out of sight during a screen share, or simply reduce visual noise in your home directory. Hiding is not encryption—the folder still exists on disk and can be accessed by anyone who knows the path or uses the right command. If you need real security, use FileVault to encrypt your entire drive or create an encrypted disk image instead.
Method 1: Use Terminal (chflags hidden)
The most reliable way to hide a folder is with the chflags command, which toggles the hidden flag on any file or directory. Here’s how:
- Open Terminal (Finder > Applications > Utilities > Terminal).
- Type
chflags hidden(with a trailing space). - Drag the folder from Finder into the Terminal window—this pastes its full path.
- Press Return. The folder disappears from Finder immediately.
To unhide it, run chflags nohidden followed by the folder’s path. If you can’t see the folder to drag it, type the path manually (e.g., chflags nohidden ~/SecretFolder).
Method 2: Use Finder’s Hidden Attribute
Finder itself doesn’t have a “Hide” button, but you can use the Get Info window to set the hidden flag on some versions of macOS. Select the folder, press Command+I, and check the “Hidden” box under the General section. This option appears in macOS Catalina and later. If you don’t see it, use the Terminal method above—it works on every macOS version.
Method 3: Hide Files with a Dot Prefix
Files and folders whose names begin with a dot (like .secret) are hidden by default in Finder and most Unix tools. To use this trick, rename the folder by adding a dot at the start: mv ~/SecretFolder ~/.SecretFolder. Finder won’t show it, but you can still navigate to it with cd ~/.SecretFolder in Terminal. This method is simple but less secure—anyone who knows the name can reveal it with ls -a.
Method 4: Use Third-Party Apps
Several Mac apps provide a graphical interface for hiding folders, such as Hider 2, Secret Folder, or LiteIcon. These apps typically add a menu bar icon or context menu item to hide/unhide folders with a click. They often include password protection, which adds a layer of access control beyond simple hiding. However, most are paid, and they rely on the same underlying chflags mechanism—so they don’t offer more security than Terminal, just convenience.
How to View Hidden Folders
To see all hidden files and folders in Finder, press Command+Shift+. (period) while in a folder. This toggles hidden items on and off. In Terminal, use ls -a to list everything, including dotfiles. If you need to unhide a folder permanently, use chflags nohidden or rename it to remove the leading dot.
Common Problems and Fixes
Hidden folder still shows up in Spotlight search: The hidden flag doesn’t remove the folder from Spotlight’s index. To prevent it from appearing in search results, add the folder to System Settings > Spotlight > Privacy > “+” and select the folder.
Folder reappears after reboot: This can happen if you used a third-party app that didn’t set the flag correctly. Re-run chflags hidden and verify with ls -lO (the letter O shows flags) that the hidden flag is present.
Can’t drag the folder into Terminal: If the folder is already hidden, use the full path manually. You can also open Terminal, type open ~ to reveal your home folder in Finder, then drag from there.
Frequently Asked Questions
Does hiding a folder free up space?
No. Hiding only changes the visibility flag—the folder and its contents remain on disk. To reclaim space, delete the folder or move it to an external drive.
Can I hide a folder on the desktop?
Yes. The chflags hidden command works on any folder, including those on the desktop. After hiding, it disappears from the desktop but remains in the Desktop folder (~/Desktop).
Is there a way to password-protect a hidden folder?
Hiding is not password protection. For password-level security, create an encrypted disk image using Disk Utility (File > New Image > Image from Folder, then choose encryption). Mount it when needed and unmount to lock it.
How do I unhide a folder if I forgot its name?
Press Command+Shift+. in Finder to reveal hidden files, then rename the folder to remove the dot prefix or run chflags nohidden on it. If you can’t see it, use Terminal’s ls -la to list all files in the parent directory.
Will hiding a folder affect Time Machine backups?
Time Machine backs up all files, including hidden ones, unless you exclude them in Time Machine settings. Hidden folders are still backed up, so they won’t be lost if your drive fails.
Can I hide a folder from other user accounts?
No. Hidden folders are visible to any user who knows the path or uses Terminal. To restrict access, change the folder’s permissions (Get Info > Sharing & Permissions) or use FileVault for full-disk encryption.
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
- Live Location Sharing for Meeting Strangers: Safe or Not?
- Why Keep OLED Switch After Buying Switch 2
- Why I Want More Sequels to Bad Games
- Gigabit Network Not Reaching Gigabit Speeds? Why
- History Command Examples: 20+ Real Uses
- Korean Luxury Sports Sedan Reliability & Performance