Viewing hidden files on a Mac is a necessary skill for developers, system administrators, and even casual users who need to troubleshoot software or manage system configurations. By default, Apple hides critical system files and "dotfiles" to prevent accidental deletion and to keep the user interface clean. However, when you need to edit your .zshrc profile, clear out cache folders, or inspect an external drive, knowing how to reveal these invisible items is essential.

Use the Global Keyboard Shortcut for Immediate Results

The most efficient method to toggle hidden files in macOS is using a built-in keyboard shortcut. This method works instantly across almost all modern versions of macOS, including Sequoia, Sonoma, Ventura, and Monterey.

To see hidden files, follow these steps:

  1. Open any Finder window or go to your Desktop.
  2. Press and hold Command (⌘) + Shift + . (Period) simultaneously.
  3. Your hidden files and folders will immediately appear. You can identify them by their semi-transparent or "ghosted" appearance.
  4. To hide the files again, simply press the same combination (Command + Shift + .) once more.

In our testing across different hardware configurations, this shortcut is processed at the Finder application level. It is important to note that if you are in an "Open" or "Save" dialog box within a third-party application (like Photoshop or Chrome), this shortcut still works, allowing you to select hidden configuration files without leaving the app.

Reveal Hidden Files Permanently Using Terminal

While the keyboard shortcut is excellent for quick tasks, it sometimes resets or doesn't persist after a full system reboot depending on specific Finder preferences. For power users who want a permanent change, the Terminal provides a more robust solution.

How to Enable Hidden Files via Command Line

  1. Open the Terminal app. You can find it in Applications > Utilities or by searching via Spotlight (Command + Space).
  2. Enter the following command exactly as shown: defaults write com.apple.finder AppleShowAllFiles -bool true
  3. Press Enter.
  4. For the changes to take effect, the Finder process must be restarted. Type the following command: killall Finder
  5. Press Enter.

Once Finder restarts, every window will display hidden items by default. This is particularly useful if you are working on a development project where you constantly need to access .env, .gitignore, or .git directories.

How to Revert to Default Hidden State

If you find that the clutter of system files is distracting, you can easily reverse the process:

  1. Open Terminal.
  2. Enter: defaults write com.apple.finder AppleShowAllFiles -bool false
  3. Enter: killall Finder

The -bool flag in these commands tells the macOS defaults system to set a boolean value (true or false) for the specific preference key AppleShowAllFiles. This is a deep system preference that overrides the standard UI behavior.

Methods to Access the Hidden Library Folder

The ~/Library folder is one of the most important hidden locations in macOS. It contains application support files, preferences, caches, and logs. Apple hides it specifically because modifying its contents can lead to app instability.

Using the Option Key in the Menu Bar

  1. Switch to Finder.
  2. Click on the Go menu in the top menu bar.
  3. Press and hold the Option (⌥) key.
  4. You will see Library appear between the "Home" and "Computer" options. Click it to open the folder directly.

Persistent Visibility for the Library Folder

If you find yourself accessing the Library folder frequently, you can make it permanently visible for your user account:

  1. Open your Home folder (the one with your name and the house icon).
  2. Go to View > Show View Options in the menu bar (or press Command + J).
  3. At the bottom of the settings panel, check the box labeled Show Library Folder.

This setting is specific to your user profile and ensures that the Library folder remains visible in your sidebar and main folder view regardless of whether other hidden files are shown.

Managing Hidden Files on External Hard Drives and USBs

A common point of confusion occurs when users connect external drives formatted as ExFAT or FAT32. macOS often creates hidden metadata files on these drives, such as .DS_Store, .Spotlight-V100, and .Trashes.

When you use the Command + Shift + . shortcut on an external drive, you will often see a folder named .Trashes. If you are trying to free up space on a USB drive and noticed that deleting files didn't increase the available storage, it is because the files are still sitting in this hidden .Trashes folder. By revealing hidden files, you can manually empty this folder or see exactly what is consuming space.

In our experience, some users report that hidden files on external drives do not appear immediately when using the shortcut. If this happens, try navigating one level up in the folder hierarchy and then back into the drive. This forces Finder to refresh the directory listing and apply the visibility toggle.

Creating a Custom Toggle Script with AppleScript

For those who want a one-click solution without memorizing shortcuts or opening Terminal, you can create a small application using Script Editor.

  1. Open Script Editor (found in Applications > Utilities).
  2. Copy and paste the following code: