macOS hides certain files by default, and you can reveal them with a keyboard shortcut or a Terminal command

Files and folders that start with a dot (.) are hidden on macOS by default. Apple does this to keep system files out of your way — you won't accidentally delete something critical. But sometimes you need to see them: a configuration file for an app, a backup folder, or a dotfile you created yourself. The fastest way to reveal hidden files is to press Command + Shift + Period (the period key) in Finder. Do it once to show hidden files, once more to hide them again.

If that shortcut doesn't work or you prefer a permanent solution, you can use Terminal to change the setting. Open Terminal (search for it in Spotlight with Command + Space), paste this command, and press Enter:

defaults write com.apple.finder AppleShowAllFiles true

Then restart Finder by holding Option, right-clicking the Finder icon in the dock, and selecting "Relaunch". Hidden files will now stay visible until you reverse the setting by replacing "true" with "false" in the command above.

Key Takeaways

  • Press Command + Shift + Period in any Finder window to toggle hidden files on and off instantly.
  • Files and folders starting with a dot (.) are hidden by default on macOS to protect system files.
  • If you want hidden files to stay visible permanently, use the Terminal command with "defaults write" and restart Finder.
  • You can search for a hidden file by name in Spotlight even if it is not visible in Finder.

Using the keyboard shortcut in Finder

The quickest method works in any Finder window. Press Command + Shift + Period and hidden files appear instantly. They show up with a lighter text color than regular files, so you can tell them apart. Press the same keys again and they disappear.

This shortcut is temporary — it only affects the current view. If you close Finder and open it again, hidden files go back to being hidden unless you have changed the system setting in Terminal. The shortcut is useful when you need to find one hidden file quickly without making a permanent change.

Making hidden files permanently visible

If you work with hidden files often, you can make them stay visible. Open Terminal (Command + Space, type "Terminal", press Enter). Copy and paste this line exactly:

defaults write com.apple.finder AppleShowAllFiles true

Press Enter. Then hold Option and right-click the Finder icon in your dock. Select "Relaunch" from the menu. Finder restarts and hidden files now appear in every window.

To reverse this later, open Terminal again and run the same command but replace "true" with "false", then relaunch Finder. There is no harm in leaving hidden files visible — you are just seeing files that were always there.

Searching for a hidden file by name

You do not need to make hidden files visible to find one. Open Spotlight (Command + Space) and type the name of the file you are looking for. Spotlight searches hidden files even when they are not displayed in Finder. Click the result to open it or reveal it in Finder.

This method is faster if you remember the file name but not where it is stored. Spotlight indexes your entire drive, including hidden folders, so it finds dotfiles and system files without you having to change any settings.

Understanding what files are hidden and why

On macOS, any file or folder whose name begins with a dot is hidden. Examples include .bash_profile (shell configuration), .ssh (secure shell keys), .git (version control data), and .DS_Store (folder display settings). These are not secret — they are just kept out of sight to reduce clutter and prevent accidental deletion.

System files like these are essential to how your Mac works. Hiding them by default protects you from moving or deleting something that an app or the operating system depends on. If you are looking for a specific hidden file, you usually know its name or what app created it. Random exploration of hidden folders is rarely necessary.

Navigating to a hidden folder using the Go menu

Another way to reach a hidden folder is through Finder's Go menu. Click "Go" in the menu bar at the top, then select "Go to Folder". Type the path to the folder you want — for example, ~/.ssh or ~/.config — and press Enter. Finder opens that folder even if hidden files are not visible elsewhere.

The tilde (~) represents your home directory, so ~/.ssh means the .ssh folder inside your home folder. This method works whether or not you have enabled hidden files globally, and it is useful if you know the exact path but do not want to search for it.

Frequently Asked Questions

Why does my Mac hide files that start with a dot?

These files are usually configuration or system files that apps and macOS need to function. Hiding them prevents you from accidentally moving, renaming, or deleting something critical. They are not secret — just kept out of the way.

Is it safe to delete a hidden file I found?

Not always. If you do not know what a hidden file does, do not delete it. System files like .DS_Store or files in .Library can break app behavior if removed. Only delete a hidden file if you created it yourself or you are certain what it is for.

Will the Command + Shift + Period shortcut work in all apps?

It works in Finder and in file dialogs within most apps. Some older or specialized applications may not recognize it. Terminal and some developer tools have their own ways of showing hidden files, but Finder is where you will use this shortcut most often.

Can I hide a file I created myself?

Yes. Rename the file so its name starts with a dot. For example, rename "notes.txt" to ".notes.txt". It will then be hidden by default. You can unhide it the same way — rename it to remove the dot.

What if I accidentally deleted a hidden file?

Check your Trash folder first — deleted files go there before they are permanently removed. If it is not there, you may be able to recover it using Time Machine if you have backups enabled. If the file was a system file and your Mac is not working properly, restart in Safe Mode or contact Apple Support.