To show hidden files on your Mac, open Terminal and run:

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

Finder will restart, and you'll see hidden files. They appear slightly faded so you can tell them apart.

To hide them again:

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

That's it.

What This Command Does

Let's break it down:

  • defaults write com.apple.finder - Changes a Finder setting
  • AppleShowAllFiles -bool true - Sets "show all files" to true
  • && - Then also do this next thing
  • killall Finder - Restarts Finder so the change takes effect

When you set it to false, you're just reversing the setting.

The Keyboard Shortcut (Easier)

There's actually a faster way that doesn't need Terminal:

In any Finder window, press:

Command + Shift + .

That's Command, Shift, and the period key. Hidden files appear immediately. Press it again to hide them.

This shortcut toggles visibility on the fly. No restart needed.

Why Files Are Hidden

Files starting with a dot (like .zshrc or .gitignore) are hidden by default on Mac. This is a Unix convention.

These files are usually configuration files that most people never need to see. Hiding them keeps Finder clean.

Common hidden files you might need:

File What it does
.zshrc Your shell configuration
.gitignore Tells Git which files to ignore
.ssh Contains SSH keys
.env Environment variables for apps
.DS_Store Finder metadata (usually ignore this)

Seeing Hidden Files in Terminal

Terminal shows hidden files differently. Use the -a flag with ls:

ls -a

This lists everything, including hidden files.

For more detail:

ls -la

This shows hidden files with permissions, sizes, and dates.

Terminal always shows hidden files with -a. The Finder setting doesn't affect Terminal.

Creating Hidden Files

To make a file hidden, just start its name with a dot:

touch .myconfig

That file won't show in Finder (unless you've enabled hidden files).

To rename an existing file to be hidden:

mv myconfig .myconfig

Common Reasons to Show Hidden Files

Editing .zshrc: Your shell configuration file. You need to see it to edit it.

Finding .git folders: When you clone a repository, the .git folder contains all version control info.

Configuring apps: Many apps store settings in hidden dotfiles.

Cleaning up: Sometimes hidden folders take up space. .Trash in external drives, for example.

Debugging: When something's wrong, the answer is often in a hidden config file.

The .DS_Store Files

When you show hidden files, you'll see .DS_Store files everywhere. These are Finder metadata files - they store view settings for each folder.

They're harmless but annoying. You can delete them:

find . -name ".DS_Store" -delete

This removes all .DS_Store files in the current directory and subdirectories.

They'll come back as you browse folders, though. That's just how Finder works.

Make It Permanent (System-Wide)

The Terminal command we used at the top makes the change permanent. Hidden files will stay visible even after restarting your Mac.

The keyboard shortcut (Command + Shift + .) is temporary - it resets when you close the Finder window.

Use whichever fits your workflow:

  • Keyboard shortcut if you only occasionally need hidden files
  • Terminal command if you always want to see them

Keep Learning

Showing hidden files is one of those things you need once and then forget about. But Terminal can do much more - navigating faster, batch operations, automation.

Check out the free course at Mac Terminal for Humans.