keepcalculator

06 Numbers and Powers

Show Hidden Files in OS X: The Complete Guide

Card No. 06·28123 · Updated · Standard formula, shown below

To show hidden files in OS X (macOS), open Terminal and type defaults write com.apple.finder AppleShowAllFiles true, then press Return and restart Finder by holding Option and right-clicking the Finder icon, then selecting “Relaunch.” This instantly reveals all hidden files and folders in the Finder. For a temporary peek without changing settings, press Command+Shift+. (period) in any Finder window or Open dialog.

Why macOS Hides Files in the First Place

macOS hides certain files and folders to keep users from accidentally deleting or modifying critical system components. The convention dates back to Unix, where files beginning with a dot (.) are treated as hidden by default. Apple extends this to many user-level files like .bash_profile, .ssh, and .Trash to reduce clutter and prevent novice users from breaking their system. Hidden files often include configuration files, cache directories, and system library files that applications need but users rarely need to see.

Method 1: Using Terminal (Permanent Toggle)

The most reliable way to show hidden files is through Terminal, which is pre-installed in macOS. Here’s the exact process:

  1. Open Terminal (Finder > Applications > Utilities > Terminal, or press Command+Space and type “Terminal”).
  2. Type the following command and press Enter:
    defaults write com.apple.finder AppleShowAllFiles true
  3. Relaunch Finder by holding Option, right-clicking the Finder icon in the Dock, and choosing “Relaunch.”

To hide them again, replace true with false in the same command and relaunch Finder. This method works on all versions of macOS from OS X Lion (10.7) through the latest releases, including Ventura and Sonoma.

Method 2: Keyboard Shortcut (Temporary View)

Starting with macOS High Sierra (10.13), Apple added a built-in keyboard shortcut: Command+Shift+. (period). Pressing this in any Finder window or Open/Save dialog instantly toggles hidden files on and off. This is ideal when you need a quick look without permanently changing your system settings. The shortcut works in most file dialogs, including when attaching files in Mail or saving from web browsers. It does not work on the desktop, so if you need to see hidden files on the desktop, use the Terminal method.

How to Choose Between the Two Methods

Your choice depends on your workflow:

  • Terminal method is best for users who need hidden files visible for extended periods, such as developers editing configuration files or designers managing website assets. It’s also the only way to show hidden files on the desktop.
  • Keyboard shortcut is perfect for occasional checks—like when you’re trying to locate a misnamed file or verify a folder’s contents. It’s faster and doesn’t require restarting Finder.

If you’re on macOS Catalina or later, you can also use Finder’s “Go to Folder” (Command+Shift+G) and type a hidden path like ~/.ssh to jump directly to that folder without revealing everything else.

Common Problems and Fixes

Several issues can arise when trying to show hidden files:

  • Finder doesn’t relaunch – If the Option+right-click method doesn’t work, use Terminal to type killall Finder and press Enter. This forces Finder to quit and restart.
  • Command+Shift+. doesn’t work – This shortcut only works in Finder windows and Open/Save dialogs, not on the desktop or in some third-party file managers. Also ensure your keyboard isn’t using a different input source that intercepts the shortcut.
  • Hidden files still not visible – Some files are protected by System Integrity Protection (SIP) and won’t show even with the setting enabled. This is normal; SIP prevents modification of system files.
  • Changes don’t persist after reboot – The Terminal command should persist, but if it doesn’t, check that you’re not using a third-party tool that resets Finder preferences. Also, verify you typed the command exactly as shown.

Hidden Files vs. Invisible Files: What’s the Difference?

In macOS, “hidden” and “invisible” are often used interchangeably, but there’s a technical distinction. A file is hidden if its name starts with a dot (like .gitignore). A file is invisible if it has the hidden flag set in its file system attributes, which can be done with the command chflags hidden filename. The Terminal method (AppleShowAllFiles) reveals both types. The keyboard shortcut also reveals both. Some files, like /etc and /var, are hidden by default because they reside in system locations that Finder doesn’t display, regardless of the setting.

Safety and Best Practices

While showing hidden files is safe in itself, you should exercise caution when interacting with them:

  • Don’t delete files you don’t recognize – Hidden files often contain critical settings. Deleting them can break applications or your system.
  • Avoid modifying system files – Files in /System and /Library are protected by SIP. Tampering with them can cause boot failures.
  • Use the keyboard shortcut for quick checks – Leaving hidden files visible permanently increases the risk of accidental modification, especially if you’re not familiar with the file structure.
  • Back up before making changes – If you plan to edit hidden configuration files, make a copy first. This is especially important for files like .bash_profile or .zshrc.

Alternatives to Showing Hidden Files

If you need to access a specific hidden file without revealing everything, consider these alternatives:

  • Go to Folder – Press Command+Shift+G in Finder and type the full path (e.g., ~/.ssh). This opens the folder directly.
  • Terminal commands – Use ls -la in Terminal to list all files, including hidden ones, in the current directory. You can also use open -e filename to edit a hidden file with TextEdit.
  • Third-party apps – Some file managers like ForkLift or Path Finder have built-in toggles for showing hidden files, but they are not necessary for most users.

Frequently Asked Questions

Q: Does the keyboard shortcut work on macOS Monterey?
A: Yes, Command+Shift+. works on all versions of macOS from High Sierra (10.13) onward, including Monterey, Ventura, and Sonoma. It toggles hidden files in Finder windows and Open/Save dialogs.

Q: How do I hide hidden files again after using the Terminal command?
A: Run the same command with false instead of true: defaults write com.apple.finder AppleShowAllFiles false, then relaunch Finder. Alternatively, press Command+Shift+. if you used the shortcut.

Q: Why can’t I see hidden files on the desktop with the keyboard shortcut?
A: The keyboard shortcut only works inside Finder windows and dialogs, not on the desktop. To show hidden files on the desktop, use the Terminal method or navigate to the desktop and press Command+Shift+. (which won’t work). The only way is to use the Terminal command.

Q: Is it dangerous to show hidden files?
A: No, merely viewing them is safe. The danger comes from modifying or deleting files you don’t understand. Always be cautious and avoid changing system files unless you know what you’re doing.

Q: Will showing hidden files slow down my Mac?
A: No, it has no performance impact. It only changes what Finder displays. However, it may clutter your view, making it harder to find files.

Q: Can I show hidden files without Terminal?
A: Yes, you can use the keyboard shortcut Command+Shift+. on macOS High Sierra and later. For older versions, you’d need Terminal or a third-party app.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →