Guides

How to Show Hidden Files on a Mac (Command-Shift-Period)

Updated July 23, 2026

The fastest way to show hidden files on a Mac is the keyboard shortcut: in Finder, press ⌘⇧. (Command-Shift-Period). Hidden files and folders appear, dimmed; press it again to hide them. This works anywhere Finder shows files — including Open and Save dialogs.

The shortcut: Command-Shift-Period (⌘⇧.)

  1. Open a Finder window (or any Open/Save dialog).
  2. Press ⌘⇧. — hold Command and Shift, then tap the period key.
  3. Dotfiles like .gitignore, .env, and folders like .ssh show up, greyed out.
  4. Press ⌘⇧. again to hide them.

This toggle has been built into Finder since macOS Sierra (2016). It’s per-session and global — it flips the view everywhere, and it’s the same key you’ll use most of the time.

Make it permanent with Terminal

If you want hidden files to stay visible without toggling, set it with a command:

defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder

To hide them again, set it back to false:

defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder

killall Finder just restarts Finder so the change takes effect — your files are untouched.

What counts as “hidden”

macOS hides two kinds of items:

  • Dotfiles — anything whose name starts with a period (.DS_Store, .gitconfig, .zshrc).
  • Flagged items — files and folders with the hidden flag set, most notably your ~/Library folder.

To reach ~/Library specifically without unhiding everything: in Finder, open the Go menu and hold (Option) — Library appears in the list. Or unhide it for good with chflags nohidden ~/Library.

A word of caution

Hidden files are hidden for a reason: most are configuration or system files, and renaming or deleting the wrong one can break an app or your setup. Showing them is safe; changing them is where care is needed.

Doing it in ComfortFiles

ComfortFiles uses the exact same shortcut you already know: ⌘⇧. toggles hidden files, and there’s a View → Show Hidden Files menu item (with a checkmark) plus a Show hidden files switch in Settings. The choice persists across relaunches, so you can leave dotfiles visible for good if that’s how you work. See how it works in ComfortFiles.