Hide any file or folder on Mac

Make a file or folder invisible in Finder without moving or renaming it.

macOSFilesHidden filesTerminalLow risk
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/myfolder

02What 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

RiskLow risk
RequirementsReplace ~/Desktop/myfolder with the actual path — drag the item from Finder into Terminal to paste its path.
CompatibilitymacOS 10.11 El Capitan – 15 Sequoia
!Warning: This hides files from Finder only — it is not encryption or access control.

04Undo

Undo
$ chflags nohidden ~/Desktop/myfolder

05Sources

  • macOS chflags command reference
    SS64 · technical · 2026-09-16
    Evidence: 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