How to Hide Files on Mac (and Why Hidden Isn't Private)

Updated Oct 30, 2026 6 min read
Quick answer

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

  1. Open Terminal

    Press ⌘Space, type Terminal and press Return.

  2. Type the command

    Type chflags hidden followed by one space. Do not press Return yet.

    chflags hidden 
  3. Drag the item in

    Drag the file or folder from a Finder window into the Terminal window. Terminal pastes its full path.

  4. 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 nohidden with 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 nohidden followed 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:

Show hidden files permanently
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder
Go back to hiding them
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:

Rename so the name starts with a dot
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

  1. Open a new Finder window and go to the folder. The item should be missing.
  2. In any app, choose File > Open and browse to the same folder. Check whether the item shows in the dialog.
  3. Press ⌘⇧. in the Finder window. If the item appears, anyone who knows the shortcut can find it too.
  4. Search for the file name with ⌘Space. If the name appears, hiding did not keep it out of search.
  5. Run ls -a or ls -lO on the folder in Terminal and look for the item.

Why hidden isn't private

Every simple hiding method is a two-second check
Way to hideHow 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

Hiding is for tidiness and casual glances only
Who looksDoes hiding stop them?
A visitor glancing at your screenYes, if they only browse in Finder
Someone who knows the shortcutNo. It takes two seconds.
Another user account on the MacNot reliably. Permissions decide who can open a file, not the hidden flag.
Anyone who copies your disk or a backupNo. The files are not encrypted.
A thief at your unlocked MacNo

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

Your files. Your Mac. Locked.

Coming soon. Join the waitlist and we email the link.

Get early access

The Mac beta opens soon

Hidden Folder is not released yet. Get the download link by email when it is.

One email when the beta opens. No spam. No account. We never sell your address.

Or follow it on GitHub