Hide files in Finder with chflags hidden
The hidden file flag hides an item from Finder and open dialogs without requiring a dot-prefix rename, which would break paths in scripts and apps.
Run `chflags hidden ~/Desktop/notes.txt` to hide the item and `chflags nohidden` on the same path to bring it back.
01Command
Command
$ chflags hidden ~/Desktop/notes.txt
chflags nohidden ~/Desktop/notes.txt02What it does
Unlike Unix's dot-file convention, the macOS hidden flag works on any file name and is what Finder itself toggles when you set visibility through other tools. Hidden items remain accessible by exact path and via Shift-Command-. in Finder, so the flag is cosmetic rather than security.
03Risk
!Warning: This hides items only from Finder views; the file is still readable by any process that knows the path.
04Undo
Undo
$ chflags nohidden ~/Desktop/notes.txt05Sources
- chflags — change file flags on macOSEvidence: Documents the hidden flag and its negation nohidden.
- Hide or show files and folders on MacEvidence: Explains that the hidden flag keeps items from appearing in Finder and how hidden items can still be reached.
Last verified: 2026-09-17 · Category: Files & Folders
06Related solutions
Show file extensions for all files on Mac
Make Finder display .pdf, .docx, .png and every other extension at all times.
Show the hidden Library folder on Mac
Permanently reveal ~/Library — where app settings, caches and support files live.
Show the path bar in Finder on Mac
Permanently display the full folder path at the bottom of every Finder window.