How to Hide Files & Folders on macOS
In this article
Hiding files and folders on macOS is a quick way to declutter your Desktop, protect sensitive documents from prying eyes, or keep system files out of sight. This guide shows you three reliable methods—using Finder, Terminal, and a keyboard shortcut—so you can hide and unhide items whenever you need. No additional software is required.
What You'll Need
- A Mac running macOS (any recent version, from Catalina to Sonoma or later)
- Administrator access to your user account (needed for Terminal commands)
- The file or folder you want to hide
Step-by-Step
Choose one of the following methods based on your comfort level.
Method 1: Using Finder (Easiest)
- Open a new Finder window by clicking the Finder icon in the Dock.
- Navigate to the location of the file or folder you want to hide.
- Right-click (or Control-click) the item. In the context menu, select Get Info (or press Cmd + I).
- In the Info window that appears, scroll down to the General section.
- Check the box next to Hidden. The item will immediately disappear from the Finder window.
- Close the Info window. The item is now hidden.
Note: This method only works in macOS Ventura and later. On older versions, the Hidden checkbox is not available in Finder.
Method 2: Using Terminal (Works on All Versions)
- Open Terminal. You can find it in Applications > Utilities, or search for it with Spotlight (Cmd + Space).
- Type the following command, but do not press Enter yet:
chflags hidden - Drag the file or folder you want to hide into the Terminal window. This will automatically insert the full path to the item. The command should now look like:
chflags hidden /Users/yourname/Documents/secretfile.pdf - Press Enter. The item will be hidden immediately.
- To unhide it later, use the same command but replace
hiddenwithnohidden:chflags nohidden /path/to/your/file
Method 3: Using a Keyboard Shortcut (Quick Toggle)
- Open System Settings (or System Preferences on older macOS) and go to Keyboard > Keyboard Shortcuts.
- In the left sidebar, select App Shortcuts.
- Click the + button to add a new shortcut.
- In the dialog, set Application to Finder.
- For Menu Title, type exactly:
Hide(this matches the Finder menu item). - For Keyboard Shortcut, press a combination you like, e.g., Cmd + Shift + H.
- Click Add. Now, select any file or folder in Finder and press your shortcut to hide it instantly. Press again to unhide (if you set a toggle).
Common Mistakes
- Forgetting the space before the path: In Terminal, the command
chflags hiddenmust be followed by a space, then the path. Dragging the file usually adds the space automatically, but if you type the path manually, ensure there is a space. - Hiding the wrong item: Double-check the path in Terminal before pressing Enter. A typo can hide the wrong file or cause an error.
- Using Finder on older macOS: The Hidden checkbox in Get Info is only available in macOS Ventura (13) and later. On older systems, use Terminal.
- Not knowing how to unhide: Hidden files are not visible in Finder, so you might forget where they are. Use Terminal with the
nohiddenflag or press Cmd + Shift + . (period) to show hidden files temporarily in Finder.
Tips
- Use a dedicated folder: Instead of hiding individual files, create a folder called “Private” and hide that. This keeps your hidden items organized.
- Show hidden files temporarily: In any Finder window, press Cmd + Shift + . (period) to toggle the display of all hidden files. This is great for quick access without unhiding permanently.
- Combine with encryption: Hiding is not security. For sensitive data, use Disk Utility to create an encrypted disk image (File > New Image > Image from Folder) and store your files there.
- Use aliases: If you hide a file but need quick access, create an alias (right-click > Make Alias) and place it elsewhere. The alias will still work even if the original is hidden.
Troubleshooting
The file doesn't disappear after using Finder
Make sure you checked the Hidden box in Get Info. If it’s already checked but the file is still visible, try restarting Finder: hold Option and right-click the Finder icon in the Dock, then select Relaunch.
Terminal says “Operation not permitted”
This usually means you don’t have full disk access. Go to System Settings > Privacy & Security > Full Disk Access, and enable Terminal. If it’s already enabled, toggle it off and on, then restart Terminal.
I can't see hidden files even with Cmd+Shift+.
This shortcut works in most Finder windows, but not in the “Recents” view. Switch to a different location like Desktop or Documents. Also, make sure you are pressing the period key (.) on your keyboard.
The hidden file still appears in Spotlight search
Hiding only affects Finder visibility, not Spotlight. To exclude it from search, add the folder to Spotlight’s privacy list: System Settings > Spotlight > Search Privacy, then add the folder.
Frequently Asked Questions
Can I hide files on macOS without using Terminal?
Yes. On macOS Ventura and later, you can use the Hidden checkbox in Get Info. For older versions, you can use third-party apps or the keyboard shortcut method described above.
Are hidden files safe from other users?
No. Hiding is a convenience feature, not a security measure. Any user with administrative access can unhide them easily. For privacy, use FileVault or encrypted disk images.
How do I unhide a file I hid with Terminal?
Open Terminal and run: chflags nohidden /path/to/file. You can also press Cmd + Shift + . in Finder to see hidden files, then right-click and uncheck Hidden (if available).
Does hiding a file free up space?
No. The file remains on your disk and takes up the same amount of space. Hiding only changes its visibility.
Can I hide files on iCloud Drive?
Yes, you can hide files stored in iCloud Drive using the same methods. However, they will still sync to your other devices, and the hidden attribute may not carry over consistently.
What is the difference between “hidden” and “invisible” files?
In macOS, “hidden” usually refers to the hidden flag (chflags) or the Finder Hidden checkbox. “Invisible” is a legacy attribute that also prevents display. Both are similar, but the hidden flag is more common and easier to toggle.