For years this required a Terminal incantation, and half the internet still tells you it does. It doesn’t: every modern version of macOS has the toggle built in. Below: the shortcut, what it’s actually flipping under the hood, the one folder it won’t help you with, and how to hide files of your own.
The shortcut: ⌘⇧.#
Press ⌘⇧. in any Finder window. Dotfiles (.gitignore, .zshrc), configuration folders, and system items fade into view at reduced opacity so you can tell them apart from regular files. The setting sticks — it stays on across windows and Finder relaunches until you press it again.
The Terminal command behind it#
The shortcut just flips a preference you can also set by hand:
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder Swap true for false to hide them again. There’s no reason to prefer this over ⌘⇧. for everyday use — it’s the same setting — but it’s useful in scripts, on locked-down machines, or when you’re configuring a Mac over SSH.
The ~/Library special case#
Your user Library folder — home of app support files, preferences, and caches — is hidden by a different mechanism, and ⌘⇧. reveals it only dimly among everything else. Two cleaner ways in:
- In Finder, open the Go menu and hold ⌥ — Library appears in the list while the key is down.
- To make it permanent: open your home folder, press ⌘J, and check Show Library Folder.
Hiding files of your own#
Two honest options, each with a caveat:
- The Unix way: name the file with a leading dot (
.notes.md). Finder will warn you that dot-files are reserved for the system, but it works. The catch: renaming it later means showing hidden files first. - The flag way: Terminal’s
chflags hidden ~/Desktop/somefilesets the same invisibility flag Apple uses, without renaming anything.chflags nohiddenundoes it.
Neither is protection — anyone can press ⌘⇧. too. For actual privacy you want an encrypted disk image, not an invisible folder.
Why macOS hides files at all#
It’s inherited Unix convention plus self-defense. Anything starting with a dot is configuration by ancient agreement; the hidden flag covers system folders macOS doesn’t want casually rearranged; and .DS_Store — the file Finder itself sprinkles into every folder to remember view settings — would be everywhere you look. Hiding them keeps everyday browsing calm. The only real sin is how long the unhide switch took to become a keystroke.
FAQ#
Does ⌘⇧. work everywhere?#
In Finder and in any app’s Open/Save dialogs, yes. It doesn’t change what Terminal shows — ls needs the -a flag for that — and Spotlight keeps its own rules and continues to ignore hidden files.
Is it safe to leave hidden files visible?#
Completely. Visibility changes nothing about the files themselves. The only rule: don’t delete or move things you don’t recognize — items like .DS_Store or .localized look like clutter but are doing quiet, harmless work.
I turned it on and now every folder is full of .DS_Store files. What are they?#
Finder’s per-folder memory — window size, icon positions, view mode. They’re safe to delete (Finder recreates them) and safe to ignore, which is exactly why they ship hidden.
Cosmil