How to Show Hidden Files on a Mac (Using Finder or Terminal)

By default, macOS hides thousands of system files, configuration documents, and library folders from the user. This is an intentional security measure designed by Apple to prevent everyday users from accidentally deleting or modifying critical files that keep the operating system running smoothly.

However, if you are a developer, a power user modifying a configuration file, or someone trying to clear out cached application data from the hidden Library folder, you will eventually need to view these invisible files. There are two primary ways to do this: using a quick keyboard shortcut in Finder, or using a Terminal command.

Method 1: The Quick Keyboard Shortcut (macOS Sierra and Later)

If you are running macOS Sierra or any newer version (which accounts for almost all Macs currently in use), you do not need to use the Terminal to reveal hidden files. Apple introduced a simple, instantly reversible keyboard shortcut.

  1. Open a Finder window.
  2. Navigate to the folder where you suspect the hidden files are located (for example, your Home folder or the Macintosh HD root directory).
  3. Press the following three keys simultaneously: Command + Shift + Period (.)

Instantly, the hidden files and folders will appear in the window. You can easily distinguish them from normal files because their icons will look slightly faded or translucent.

To hide them again and restore your Finder to its default, clean state, simply press Command + Shift + Period (.) a second time.

Method 2: Using the Terminal (Older Macs or Persistent Viewing)

If you are using an older version of OS X (El Capitan or earlier), or if you want hidden files to permanently remain visible across all Finder windows without having to constantly use the keyboard shortcut, you must use a Terminal command to change the system defaults.

  1. Press Command + Spacebar to open Spotlight Search.
  2. Type Terminal and press Enter to open the command-line interface.
  3. Copy and paste the following command exactly as written, then press Enter:
defaults write com.apple.finder AppleShowAllFiles -bool true

This command changes the hidden preference to “true.” However, the Finder is currently running and hasn’t registered the change yet. You must restart the Finder for it to take effect.

  1. Copy and paste this second command, then press Enter:
killall Finder

Your desktop icons will briefly disappear and reappear as the Finder restarts. All hidden files across your entire system will now be permanently visible (appearing faded).

How to Re-Hide the Files via Terminal

Leaving hidden files visible permanently is generally not recommended, as it clutters your folders and increases the risk of accidental deletion. When you are finished with your task, you should hide them again.

  1. Open the Terminal again.
  2. Run this command to revert the preference to “false”:
defaults write com.apple.finder AppleShowAllFiles -bool false
  1. Restart the Finder again to apply the change:
killall Finder

A Warning About Hidden Files

If a file begins with a period (e.g., .DS_Store or .Trash), macOS hides it for a reason. These files dictate folder layouts, store application states, or contain core system architecture. Do not move, rename, or delete any hidden file unless you know exactly what it does and why you are modifying it. Deleting the wrong hidden file can cause applications to crash or force you to reinstall macOS entirely.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.