Skip to content

Mac file guides

How to show hidden files on a Mac

By · Updated · 4 min read

Short answer

In any Finder window, press Command-Shift-Period (⇧⌘.). Hidden files and folders appear dimmed; press the same keys again to hide them. It also works in Open and Save dialogs. To reach your Library folder, hold Option and choose Go › Library in Finder’s menu bar.

What are hidden files on a Mac?

Files macOS keeps out of sight so they aren’t moved or deleted by accident: any name that starts with a dot (.zshrc, .gitignore, .DS_Store), your ~/Library folder, and system folders like /usr and /private. Apps and developer tools keep their settings in them.

How do I show hidden files in Finder?

  1. 1Open a Finder window, or the folder you want to look in.
  2. 2Press ⇧⌘. (Command, Shift and the full stop).
  3. 3Hidden items appear, slightly dimmed. Press ⇧⌘. again to hide them.

The setting sticks until you press the keys again, in every Finder window.

How do I open the Library folder?

  1. 1In Finder, open the Go menu and hold Option. Library appears in the list.
  2. 2Or choose Go › Go to Folder (⇧⌘G), type ~/Library and press Return.

How do I show hidden files with Terminal?

This turns hidden files on for Finder and restarts Finder so it takes effect. Use false instead of true to turn them off again:

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

To list hidden files without changing Finder, use ls -la in any folder.

How do I hide a file or folder?

chflags hidden ~/Desktop/example.txt

chflags nohidden makes it visible again. Renaming a file to start with a dot hides it too, but some apps then stop recognising it.

Hidden files in Peekaboo

Peekaboo uses the same keys as Finder: ⇧⌘. shows hidden files everywhere in the app. Its search goes further than Spotlight, which skips most hidden files: add hidden: to a search to look only at them, and Search Everywhere walks the whole disk for what Spotlight never indexed. With developer features on, Dotfiles & Config gathers the settings files tools keep in your home folder, and files holding keys or tokens are never previewed.

  1. 1Show or hide hidden files.⇧⌘.
  2. 2Search with hidden: plus a name or extension, for example hidden: zshrc.⌘F

Questions

Why can’t Spotlight find hidden files?

Spotlight doesn’t index most hidden files and folders. Use Finder with hidden files shown, find in Terminal, or a search tool that walks the disk itself.

Is it safe to delete hidden files?

Usually not. Most hold settings an app or macOS needs. .DS_Store files are the safe exception: Finder recreates them.

Why doesn’t ⇧⌘. work?

Click inside the Finder window first so it has focus, and use the full-stop key on the main keyboard. On some keyboard layouts the shortcut differs; the Terminal command works everywhere.

Your privacy choices

With your permission, Google Analytics measures visits to this site using cookies. Privacy policy.