Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Show Hidden Files Mac Keyboard Shortcut

· 6 min read · Home Automation

In this article
  1. What Are Hidden Files on a Mac?
  2. How the Shortcut Works
  3. How to Use the Shortcut
  4. Alternative Methods to Show Hidden Files
  5. Common Problems and Troubleshooting
  6. Safety and Precautions
  7. Frequently Asked Questions

The keyboard shortcut to show hidden files on a Mac is Command + Shift + Period (⌘⇧.) when you are in an Open or Save dialog box, and Command + Shift + Period also works in the Finder to toggle hidden files on and off. This single shortcut is the fastest way to reveal invisible files and folders without opening Terminal.

What Are Hidden Files on a Mac?

Hidden files on macOS are files and folders that begin with a period (.) in their name, such as .gitignore, .DS_Store, or .bash_profile. Apple hides these by default to keep users from accidentally modifying system files or configuration files that are essential for apps and the operating system to work correctly. They are not secret or encrypted; they are simply invisible to the normal user interface to reduce clutter and prevent accidental damage.

In addition to dotfiles, macOS also hides entire system folders like ~/Library and the /System directory. These are protected at a deeper level, and the simple keyboard shortcut will not reveal them in all contexts. For example, ~/Library is hidden from the Finder by default, but you can jump to it directly using the Go menu (hold down the Option key while clicking Go to see the Library option).

How the Shortcut Works

The shortcut works by toggling the Finder's display setting for hidden files. When you press Command + Shift + Period, the Finder immediately refreshes the current folder view to include or exclude hidden files. This is a global toggle, meaning it applies to all Finder windows and even to Open/Save dialogs in any app.

Here is what happens in different contexts:

  • In the Finder: Pressing the shortcut once shows hidden files; pressing it again hides them.
  • In Open/Save dialogs: The same shortcut works, so you can navigate to hidden directories when saving or opening files.
  • On the Desktop: The shortcut also affects the Desktop, showing hidden files there as well.

The shortcut is part of the Finder's view options and is not a system-wide keyboard setting. It is a built-in behavior that has existed since macOS 10.12 Sierra, and it remains in current versions of macOS.

How to Use the Shortcut

Using the shortcut is straightforward, but there are a few practical steps to get the most out of it:

  1. Open a Finder window and navigate to the folder where you suspect hidden files exist.
  2. Press Command + Shift + Period simultaneously.
  3. Hidden files and folders will appear with a semi-transparent icon, indicating they are normally hidden.
  4. To hide them again, press the same shortcut once more.

If you are in an Open or Save dialog, the shortcut works the same way. For example, when saving a configuration file that starts with a dot, you can press the shortcut to see other dotfiles in the folder and navigate to the correct location.

Alternative Methods to Show Hidden Files

While the keyboard shortcut is the quickest method, there are other ways to reveal hidden files on a Mac. Each has its own use case:

  • Terminal command: Open Terminal and type defaults write com.apple.finder AppleShowAllFiles -bool true then press Enter, followed by killall Finder to restart the Finder. This sets the preference permanently until you change it back (using false instead of true).
  • Finder menu (for Library): In the Finder, click Go in the menu bar, then hold down the Option key. The Library option will appear in the dropdown menu. This only reveals the Library folder, not all hidden files.
  • Third-party apps: Some file manager apps like ForkLift or Path Finder show hidden files by default or via a button, but the built-in shortcut is usually sufficient.

The Terminal method is useful if you want hidden files to be visible every time you open the Finder, rather than toggling manually. However, it is a persistent change, so you may want to revert it after you are done to keep your workspace clean.

Common Problems and Troubleshooting

If the shortcut does not work, there are a few common reasons:

  • Keyboard focus: The shortcut only works when the Finder or an Open/Save dialog is active. If you are in a different app, it may not respond. Click on the Finder window first.
  • Full Keyboard Access: In System Settings > Keyboard > Keyboard Shortcuts, if you have customized shortcuts, the default might be overridden. Check that no conflicting shortcut is assigned to Command+Shift+Period.
  • macOS version: The shortcut has been available since macOS Sierra (10.12). If you are on an older version, use the Terminal method.
  • Stuck toggle: If hidden files remain visible after pressing the shortcut, try pressing it again, or use the Terminal command to set the preference to false and restart the Finder.

If the shortcut works but hidden files do not appear in a specific folder, it may be that the folder itself is not a standard Finder view, such as a network volume or a package contents view. In those cases, the shortcut may not apply.

Safety and Precautions

Hidden files are hidden for a reason. Many of them are critical system files or application support files. If you delete or modify them, you can break an app or even the operating system. Here are some safety tips:

  • Do not delete unknown files: If you do not know what a file does, leave it alone. Especially avoid deleting files in /System, /Library, or ~/Library.
  • Use the shortcut temporarily: Toggle hidden files on, do what you need, then toggle them off. This reduces the risk of accidentally interacting with hidden files.
  • Back up before changes: If you are editing a configuration file, make a backup first. For example, copy .bash_profile to .bash_profile.backup before editing.
  • Be cautious with Terminal commands: The defaults write command is safe, but always double-check the domain and key before running it.

If you are troubleshooting a problem and need to access hidden files, it is often better to use the shortcut rather than making permanent changes. This way, you avoid leaving the system in a state where hidden files are always visible, which can lead to accidental modifications.

Frequently Asked Questions

Does Command+Shift+Period work in all apps?

No, it only works in the Finder and in Open/Save dialogs. In other apps, such as text editors or browsers, it will not reveal hidden files. If you need to access hidden files from within an app, use the app's own file browser or navigate to the file in the Finder first.

Why can't I see hidden files in Terminal?

Terminal does not hide files by default; it shows all files including hidden ones when you use the ls -a command. The keyboard shortcut only affects the Finder GUI. If you want to see hidden files in Terminal, just use ls -a or ls -la.

Will the shortcut show files in iCloud Drive?

Yes, if the iCloud Drive folder is mounted in the Finder, the shortcut will show hidden files within it, as long as they exist. However, iCloud Drive may not sync hidden files by default, so you might not see any.

How do I hide files again after using the shortcut?

Simply press Command + Shift + Period again. The Finder will toggle back to hiding hidden files. If you used the Terminal method, you need to change the preference back to false and restart the Finder.

Is there a way to hide a file without a period?

Yes, you can use the Terminal command chflags hidden /path/to/file to hide any file or folder, regardless of its name. To unhide it, use chflags nohidden. This is different from the dotfile convention and is a separate mechanism.

What is the difference between hidden files and system files?

Hidden files are typically user-level configuration files that start with a dot, while system files are essential to macOS and are protected by System Integrity Protection (SIP). The keyboard shortcut will show hidden files, but it will not show system files that are protected by SIP, such as those in /System.