How to Find a Hidden File on Mac

macOS hides certain files and folders by default — not to be secretive, but to protect system-critical data from accidental modification. The result is that files you need (or files you didn't know existed) can seem to vanish entirely. Understanding why files are hidden, and how to surface them, is the first step to working more confidently with your Mac's file system.

Why macOS Hides Files in the First Place

Apple uses a hidden file attribute — inherited from Unix — to mark files that most users should never touch. These include system configuration files, library folders, application support data, and dot files (files whose names begin with a period, like .bash_profile or .DS_Store).

Hiding these files serves a real purpose: accidental deletion or editing of system files can break applications or destabilize macOS itself. But for developers, power users, or anyone troubleshooting software, accessing these files is often necessary.

Hidden files fall into a few general categories:

  • Dot files — files beginning with . (a Unix convention for hidden files)
  • Library folders — particularly ~/Library, which stores app preferences, caches, and support files
  • System-level directories — such as /private, /usr, and /var
  • Files hidden via the macOS hidden flag — set using the chflags hidden command or by certain apps

Method 1: Keyboard Shortcut in Finder 🔍

The fastest way to reveal hidden files in any Finder window is a simple keyboard shortcut:

Command (⌘) + Shift + Period (.)

Press this combination while a Finder window is open, and all hidden files and folders in that location will appear, shown in a slightly greyed-out style to distinguish them from normal files. Press the same shortcut again to hide them.

This method is non-destructive and temporary — it doesn't change any file attributes, just toggles your view. It works across all macOS versions from Sierra onward.

Method 2: Using Terminal to Show Hidden Files System-Wide

If you want hidden files to remain visible across all Finder windows permanently (until you reverse it), Terminal gives you that control.

Open Terminal (found in Applications → Utilities) and enter:

defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder 

Finder will restart and display all hidden files going forward. To reverse this:

defaults write com.apple.finder AppleShowAllFiles FALSE killall Finder 

This approach is popular with developers who regularly work with dot files or need persistent access to hidden directories.

Method 3: Accessing the Hidden Library Folder Directly

The ~/Library folder is one of the most commonly needed hidden locations — it holds app preferences, cached data, and configuration files. macOS hides it by default but offers a direct route:

  1. Open Finder
  2. Click the Go menu in the menu bar
  3. Hold down the Option (⌥) key
  4. Library will appear in the dropdown — click it

This takes you straight to your user Library folder without enabling hidden files globally. It's a clean option when you only need that specific location.

Method 4: Using Go → Go to Folder

If you know the path of a hidden file or folder, you can navigate directly to it:

  1. In Finder, click GoGo to Folder (or press ⌘ + Shift + G)
  2. Type the path, such as /usr/local/ or ~/.ssh
  3. Press Return

This method works even when hidden files are not globally visible. It's especially useful for accessing dot folders like ~/.config or ~/.ssh without exposing your entire file system.

Method 5: Terminal ls Command for Targeted Searches

When you need to find a specific hidden file and aren't sure of its exact location, Terminal's ls command is precise:

ls -la ~/ 

The -a flag includes all files, including dot files. The -l flag shows them in a detailed list format with permissions, size, and modification dates.

For a recursive search across subdirectories, find is more powerful:

find ~/ -name ".filename" 2>/dev/null 

Replace .filename with the actual file name. The 2>/dev/null portion suppresses permission error messages, keeping results clean.

The Variables That Change Your Approach

Which method works best isn't universal — it depends on several factors specific to your situation:

FactorHow It Affects Your Approach
macOS versionKeyboard shortcut works on Sierra+; Terminal commands vary slightly across versions
Technical comfortTerminal methods are more powerful but require familiarity with command-line syntax
How often you need accessOne-time access vs. regular need changes whether a permanent or temporary toggle makes sense
Specific file vs. general browsingKnowing the file path makes Go to Folder ideal; unknown location calls for Terminal search
Admin permissionsSome hidden files require elevated privileges (sudo) to view or modify

What "Hidden" Doesn't Always Mean

Worth noting: a file appearing hidden in Finder doesn't necessarily mean it's inaccessible or sensitive. Many developer tools, version control systems, and apps create dot files in your home directory as part of normal operation. Equally, some files buried in system directories carry real risk if modified without care. 🛠️

The method you use to surface hidden files matters less than understanding what you're looking at once you find them. A hidden configuration file in ~/.config is usually safe to inspect. A file inside /System/Library is a different matter entirely.

Your comfort level with the command line, how frequently you need to access hidden files, and whether you're looking for one specific file or browsing broadly — these are the factors that make one approach genuinely better than another for your particular workflow.