How to Hide Files on Mac (and Why Hidden Isn't Private)
To hide a file on a Mac, type chflags hidden in Terminal, add a space, drag the file in and press Return. Finder stops showing it. Press ⌘⇧. in a Finder window to show hidden items again. Hiding only removes a file from view. Anyone who knows the shortcut can see it, so it does not make files private.
Steps use macOS 14 and later names. Menu wording can differ slightly between versions.
Hide a file or folder with Terminal
-
Open Terminal
Press ⌘Space, type Terminal and press Return.
-
Type the command
Type
chflags hiddenfollowed by one space. Do not press Return yet.chflags hidden -
Drag the item in
Drag the file or folder from a Finder window into the Terminal window. Terminal pastes its full path.
-
Press Return
The item disappears from Finder. If it is still on screen, switch to another folder and back.
If it does not work
- "No such file or directory". The path has a typo. Drag the item into Terminal instead of typing the path, so Terminal pastes the exact text.
- The item is still visible. Finder may need a refresh. Switch to another folder and back, or run
killall Finder. - You hid the wrong item. Run
chflags nohiddenwith the same path.
Hide many files at once
Put the files in one folder and hide the folder. Nothing inside it shows when you browse in Finder. Each file inside keeps no flag of its own, so it is visible again the moment you move it out.
Show it again
- In a Finder window press ⌘⇧. (Command, Shift and Period). Hidden items appear, slightly faded. Press it again to hide them.
- To remove the hidden flag for good, run
chflags nohiddenfollowed by the path.
We did not find the ⌘⇧. shortcut in Apple's published list of Mac keyboard shortcuts. People use it widely, but Apple does not document it, so it could change. If it does nothing on your Mac, list the folder in Terminal with ls -a instead.
Always show hidden files
The ⌘⇧. shortcut toggles hidden items. To show them all the time, run this in Terminal, then restart Finder:
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder Hide by putting a dot in the name
Files and folders whose names start with a period are treated as hidden. Finder warns you if you rename one that way in the Finder, so Terminal is simpler:
mv ~/Documents/plans.pdf ~/Documents/.plans.pdf Hide photos in the Photos app
In Photos, select the pictures and choose Image > Hide Photo. They move to the Hidden album, which Apple says is locked by default. Apple also says the photos are not deleted and stay in your library, and that with iCloud Photos on, photos you hide on one device are hidden on your other devices too. See hide photos on Mac, how to hide photos on any device and how to hide videos.
Test that a file is really hidden
- Open a new Finder window and go to the folder. The item should be missing.
- In any app, choose File > Open and browse to the same folder. Check whether the item shows in the dialog.
- Press ⌘⇧. in the Finder window. If the item appears, anyone who knows the shortcut can find it too.
- Search for the file name with ⌘Space. If the name appears, hiding did not keep it out of search.
- Run
ls -aorls -lOon the folder in Terminal and look for the item.
Why hidden isn't private
| Way to hide | How someone finds it |
|---|---|
| chflags hidden | ⌘⇧. in Finder, or ls -lO in Terminal |
| Name starting with a dot | ⌘⇧. in Finder, or ls -a in Terminal |
| Hidden folder in a Save or Open dialog | ⌘⇧. works in those dialogs too |
- Hidden files are not encrypted. Anyone who can open them can read them.
- Backups include them.
- Copying a hidden folder to a USB drive copies the contents, readable by anyone.
What hiding leaves behind
- Backups. A Time Machine backup holds hidden files, and an old backup keeps a copy after you delete the file. Apple says excluded items still appear in local snapshots. The Options button is in System Settings > General > Time Machine.
- Search. Do not assume Spotlight skips a hidden file. To keep a folder out of search, add it in System Settings > Spotlight > Search Privacy.
- Recent lists. A file you opened can stay in Apple menu > Recent Items until you choose Clear Menu. Apple also says Go to Folder offers recent pathnames as you type, so a path you typed to a hidden folder can come back as a suggestion.
Who hiding stops and who it does not
| Who looks | Does hiding stop them? |
|---|---|
| A visitor glancing at your screen | Yes, if they only browse in Finder |
| Someone who knows the shortcut | No. It takes two seconds. |
| Another user account on the Mac | Not reliably. Permissions decide who can open a file, not the hidden flag. |
| Anyone who copies your disk or a backup | No. The files are not encrypted. |
| A thief at your unlocked Mac | No |
Hide and encrypt with Hidden Folder
Frequently asked questions
How do I see hidden files on a Mac?
Press ⌘⇧. in a Finder window. Press it again to hide them.
How do I unhide a file?
Run chflags nohidden followed by the file path in Terminal. If the name starts with a dot, rename it without the dot.
Can I hide a file with a right-click?
Finder has no hide option in the right-click menu for files. Use Terminal, or put the file in an encrypted container.
Do hidden files take up space?
Yes. They are normal files that Finder does not list.
Are hidden files safe from other people?
No. Anyone who knows the shortcut or opens Terminal can see them. Hiding is not security.
Will Spotlight still find a hidden file?
It may, so do not rely on hiding to keep a name out of search. Search for the file name to check, and add the folder to Search Privacy in System Settings > Spotlight to keep it out.
Are hidden files included in backups?
Yes. Backups include them, and an old backup keeps a copy after you delete the file.
References
- Apple Support: Hide photos and videos in Photos on Mac
- Apple Support: Create a disk image in Disk Utility
- Apple Support: Hide photos with the Hidden album
- Apple Support: Mac keyboard shortcuts
- Apple Support: Exclude files from a Time Machine backup on Mac
- Apple Support: Prevent Spotlight searches in specific folders or disks
- Apple Support: Open recently used items on Mac
- Apple Support: Go directly to a specific folder on Mac
Your files. Your Mac. Locked.
Coming soon. Join the waitlist and we email the link.
Get early access