Hide any file or folder on Mac
Make a file or folder invisible in Finder without moving or renaming it.
Run the command below with your own path — the item vanishes from Finder and the desktop immediately but stays exactly where it is.
01Command
Command
$ chflags hidden ~/Desktop/myfolder02What it does
chflags hidden sets the same UF_HIDDEN filesystem flag macOS uses for system folders. Nothing is moved, renamed or deleted — the item is just not drawn by Finder, and files inside remain accessible to apps and to Terminal. Show it again with chflags nohidden, or reveal hidden items temporarily with Shift+Cmd+. in Finder. Hidden does not mean protected: anyone who knows the flag can reveal it.
03Risk
!Warning: This hides files from Finder only — it is not encryption or access control.
04Undo
Undo
$ chflags nohidden ~/Desktop/myfolder05Sources
- macOS chflags command referenceEvidence: chflags hidden sets the UF_HIDDEN flag on a file or directory, hiding it from Finder while it stays on disk.
Last verified: 2026-09-16 · Category: Files & Folders
06Related solutions
Find files larger than 500 MB on Mac
List the biggest files in your home folder that are eating disk space.
Batch-rename file extensions on Mac (jpeg → jpg)
Change the extension of every matching file in a folder with one shell loop.
Change where screenshots are saved on Mac
Point macOS screen captures at any folder you choose instead of the desktop.