Skip to content
Guide

How to Show Hidden Files on Mac: Keyboard Shortcut

Published on

·

5 min read

How to Show Hidden Files on Mac: Keyboard Shortcut — OnVerdict

If you’ve ever needed to edit a .zshrc file, find a .env config, or figure out where an app hid its data — you’ve hit the invisible wall. macOS hides thousands of files and folders by default. Most of them you should never touch. But the ones you need? They’re annoyingly invisible until you know the trick.

Good news: it’s one keyboard shortcut.

The Keyboard Shortcut (Memorize This)

In any Finder window, press:

Cmd + Shift + . (period)

That’s it. Hidden files and folders appear instantly, slightly translucent so you can distinguish them from normal files. Press the same shortcut again to hide them.

This works in every Finder window, including Open and Save dialogs. If an app asks you to select a file and you need to pick a hidden one, Cmd+Shift+Period works there too.

We use this shortcut multiple times a day. It’s worth committing to muscle memory.

Access the ~/Library Folder

The ~/Library folder is where macOS stores app preferences, caches, application support data, and more. It’s hidden by default because Apple (reasonably) doesn’t want casual users accidentally deleting their app data.

Three ways to access it:

Method 1: Go Menu + Option Key

  1. Open Finder
  2. Click the Go menu in the menu bar
  3. Hold the Option key — “Library” appears in the dropdown
  4. Click Library

Method 2: Go to Folder

  1. In Finder, press Cmd+Shift+G
  2. Type ~/Library
  3. Press Enter

Method 3: The Keyboard Shortcut

Just press Cmd+Shift+Period in your home folder. The Library folder (along with other hidden folders) becomes visible. Navigate into it normally.

Once you’re in ~/Library, you’ll see folders like Application Support, Caches, Preferences, and Logs. This is where you go to manually clean up after uninstalling apps, or to edit app configuration files.

Terminal Method (Permanent Toggle)

The keyboard shortcut is a temporary toggle — it resets when you close Finder or restart. If you want hidden files visible permanently, use Terminal.

Show All Hidden Files

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

Hide Them Again

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

The killall Finder command restarts Finder so the change takes effect immediately. Don’t worry — it’s harmless. Finder relaunches in about one second.

We’d recommend against leaving this on permanently. Your Desktop, Documents, and Downloads folders are cluttered with .DS_Store files and other system hidden files that you don’t want to see every day. Use the keyboard shortcut for on-demand access instead.

Common Hidden Files You’ll Encounter

Here are the hidden files and folders you’re most likely to actually need:

~/.zshrc

Your shell configuration file. If you’re a developer, this is where you add PATH exports, aliases, and environment variables. Every macOS Terminal tutorial will eventually ask you to edit this file.

To edit it: nano ~/.zshrc or open ~/.zshrc (opens in your default text editor).

~/.gitignore (global)

Your global Git ignore rules. Useful for ignoring .DS_Store files across all repositories.

~/.env

Environment variable files used by countless development tools and frameworks. These often contain API keys and secrets — which is exactly why they’re hidden and should be in your .gitignore.

~/.ssh/

Contains your SSH keys (id_rsa, id_ed25519, known_hosts). Critical for Git authentication, server access, and remote connections. Never share the files in this folder — especially not the ones without .pub extensions.

.DS_Store

macOS creates these in every folder you visit in Finder. They store folder view settings (icon size, sort order, etc.). Harmless, but annoying in Git repositories. Add .DS_Store to your global gitignore.

~/Library/Application Support/

Not technically a dotfile, but hidden by default. This is where apps store their data — browser profiles, app databases, configuration files.

Warning: Don’t Delete System Hidden Files

This is important enough to call out explicitly. Many hidden files in your root directory (/) and /System/ are critical for macOS to function. Files like:

  • .fseventsd (file system events)
  • .Spotlight-V100 (search index)
  • .vol (volume references)
  • Anything in /System/Library/

Deleting these can break your Mac. In some cases, you’d need to reinstall macOS entirely. The rule is simple: if you don’t know what a hidden file does, leave it alone. The ones you need to edit — .zshrc, .gitignore, .env — you’ll know because a tutorial or tool told you to.

How to Create Your Own Hidden Files

Any file or folder with a name starting with a dot (.) is automatically hidden in Finder.

In Terminal

touch .my-hidden-file
mkdir .my-hidden-folder

Rename an Existing File

mv my-file.txt .my-file.txt

You can’t rename a file to start with a dot in Finder directly — macOS will warn you that dot-files are reserved for the system. Use Terminal for this, or rename via a Save As dialog in a text editor.

This is actually useful for hiding files on a shared drive or keeping personal config files out of the way. Just remember that anyone who knows the Cmd+Shift+Period shortcut can see them. It’s obscurity, not security.

Quick Reference

ActionMethod
Toggle hidden files in FinderCmd+Shift+.
Open ~/LibraryGo menu + hold Option
Go to any hidden pathCmd+Shift+G in Finder
Permanently show hidden filesdefaults write Terminal command
Create a hidden filePrefix filename with a dot

The keyboard shortcut alone covers 95% of cases. Learn that one, and you’re set.

More Guides