How to Show Hidden Files on a Mac

Illustration for How to Show Hidden Files on a Mac

macOS hides certain files and folders to keep Finder easier to use and to prevent accidental changes to items required by the operating system or an app. You may need to reveal them when troubleshooting an application, accessing a configuration folder, locating a library file, or following technical instructions.

There are two practical ways to view hidden files on a Mac:

  • Use the Command-Shift-Period keyboard shortcut in Finder.
  • Use Terminal to change Finder’s AppleShowAllFiles preference, then restart Finder.

The keyboard shortcut is the simplest option for temporarily viewing hidden files. The Terminal method changes Finder’s preference and is useful when you want the setting to remain enabled until you turn it off.

Quick Answer

To show hidden files in Finder:

  1. Open Finder.
  2. Open the folder where you want to view hidden items.
  3. Press Command-Shift-Period ( + + .).

Hidden files and folders will appear with lighter, semi-transparent icons. Press the same shortcut again to hide them.

To enable hidden files through Terminal, open Terminal and run:

defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder

The first command tells Finder to show hidden files. The second closes and relaunches Finder so the preference takes effect.

Show Hidden Files with a Keyboard Shortcut

The Finder keyboard shortcut is the fastest way to show hidden files on a Mac. It works in modern versions of macOS and does not require you to change a persistent Finder preference.

Steps to reveal hidden files

  1. Open Finder from the Dock.
  2. Navigate to the folder you want to inspect.
  3. Press Command-Shift-Period.

In text form, the shortcut is:

Command-Shift-Period

You can also think of it as:

⌘ + ⇧ + .

After pressing the shortcut, hidden files and folders appear in the current Finder window. Their names and icons are usually displayed with a faded or semi-transparent appearance to distinguish them from ordinary visible items.

Press Command-Shift-Period again to hide the items.

What this shortcut does

The shortcut toggles Finder’s hidden-file display. It does not change, rename, move, or delete any files. It only controls whether Finder displays items that macOS normally keeps out of view.

The setting may apply to Finder windows more broadly than the single folder you are viewing, depending on your macOS version and Finder’s current state. If hidden items do not appear immediately, click another folder, close and reopen the Finder window, or try the shortcut again.

Viewing hidden files in a specific folder

Some common locations contain hidden items, including:

  • Your user Library folder
  • The root level of your Mac’s startup disk
  • Application support folders
  • Temporary or configuration directories
  • Folders whose names begin with a period (.)

To open your user Library folder in Finder:

  1. Click Go in the menu bar.
  2. Hold the Option key.
  3. Select Library.

You can then use Command-Shift-Period to reveal hidden items inside that folder.

Another way to open a specific location is to select Go > Go to Folder and enter its path. For example:

~/Library

The tilde (~) represents your home folder.

If the shortcut does not work

Make sure Finder is the active application before pressing the shortcut. Click a Finder window or click the Finder icon in the Dock, then try again.

Also check that you are pressing the period key, not the comma key:

Command-Shift-Period

On some keyboard layouts, the punctuation key may be positioned differently. If the shortcut still does not work, use the Terminal method below.

Show Hidden Files Using Terminal

Terminal can change Finder’s AppleShowAllFiles preference. This preference controls whether Finder displays files and folders that macOS marks as hidden.

Enable hidden files

  1. Open Terminal. You can find it in Applications > Utilities, or search for it with Spotlight.
  2. Enter the following command:
defaults write com.apple.finder AppleShowAllFiles -bool true
  1. Press Return.
  2. Restart Finder by running:
killall Finder

Finder will close and reopen. Existing Finder windows may close during the restart, so save any work in other applications before running the command.

What each command changes

The first command writes a preference for Finder:

defaults write com.apple.finder AppleShowAllFiles -bool true

Here is what the parts mean:

  • defaults accesses macOS application preferences.
  • write changes a preference value.
  • com.apple.finder identifies Finder’s preference domain.
  • AppleShowAllFiles is the preference that controls hidden-file visibility.
  • -bool true sets the preference to enabled.

This command does not modify the hidden files themselves. It changes only Finder’s display behavior.

The second command is:

killall Finder

This ends the running Finder process. macOS automatically relaunches Finder because it is a core system application. Restarting Finder causes it to reread the updated preference.

Confirming the setting

After Finder restarts, open a folder that contains hidden items. They should be visible with faded icons.

If they do not appear, run the commands again in the same order:

defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder

You can also use the keyboard shortcut after Finder restarts:

Command-Shift-Period

The shortcut may toggle the display state, so note whether hidden files are currently visible before pressing it.

Important Terminal distinction

The defaults command changes Finder’s preference, while the keyboard shortcut changes Finder’s current display state. Both methods affect visibility, not the contents of hidden files.

Do not confuse the Finder command above with commands that use chflags, such as:

chflags nohidden filename

A chflags command changes a file’s hidden attribute. That is a different and more persistent change to the file itself. For simply viewing hidden files, the Finder shortcut or AppleShowAllFiles preference is generally safer.

How to Hide the Files Again

Hide files with the keyboard shortcut

In Finder, press:

Command-Shift-Period

This toggles hidden files off.

Hide files with Terminal

To restore Finder’s normal hidden-file display, run:

defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder

The first command sets AppleShowAllFiles to false, telling Finder not to display hidden items. The second command restarts Finder so the change takes effect.

This is the safe way to undo the persistent Terminal change:

defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder

On some macOS versions, deleting the preference instead of setting it to false also returns Finder to its default behavior:

defaults delete com.apple.finder AppleShowAllFiles
killall Finder

Setting the value to false is more explicit and easier to understand. If defaults delete reports that the preference does not exist, no action is required.

If Finder does not relaunch

If Finder does not reopen automatically after killall Finder, click the Finder icon in the Dock. You can also press Option, Control-click the Finder icon, and choose Relaunch if that option is available.

Why Some Hidden Files Should Stay Hidden

Hidden files are not automatically dangerous, but many are hidden because they are intended for macOS, applications, or advanced configuration tasks. Examples include:

  • Files beginning with a period, such as .config or .gitignore
  • System folders and support files
  • Application databases and preference files
  • Caches and temporary data
  • Files used for permissions, indexing, or synchronization
  • Metadata files created by macOS or third-party applications

Deleting or moving an unfamiliar hidden file can cause an application to lose settings, prevent a folder from working correctly, or create other unexpected problems. Renaming a hidden file can have similar consequences.

Before changing a hidden item:

  1. Confirm its purpose using reliable documentation for the relevant app or macOS feature.
  2. Make a backup if the file is important.
  3. Change only the item required for the task.
  4. Avoid changing files in system locations unless you understand the result.
  5. Restore the original name or location when troubleshooting instructions require it.

Showing hidden files is generally low risk because it changes only what Finder displays. Modifying or deleting them is a separate action and may not be reversible without a backup.

Troubleshooting

The Command-Shift-Period shortcut does nothing

Click a Finder window first, then press Command-Shift-Period. The shortcut applies to Finder, not necessarily to another active application.

If you use a nonstandard keyboard layout, the period key may not be where you expect. Try the Terminal method instead.

Hidden files appear, but the icons look faded

That is normal. Finder uses a lighter, semi-transparent appearance to indicate that the items are hidden by default. The files are still available and can usually be opened or selected.

The Terminal command returns an error

Check that the command is typed exactly as shown. The preference name is case-sensitive:

AppleShowAllFiles

Run the commands separately:

defaults write com.apple.finder AppleShowAllFiles -bool true

Then:

killall Finder

If Terminal asks for a password, do not enter one for these commands under normal circumstances. The commands do not require administrator privileges when changing your Finder preferences.

Finder does not refresh

Restart Finder again:

killall Finder

You can also close and reopen the affected Finder window. If the setting still does not appear to work, restart your Mac and test the shortcut in a new Finder window.

I accidentally changed a hidden file

If you moved or renamed a file, return it to its original name and location if you know what they were. If you deleted it, check the Trash before emptying it. A current backup, such as a Time Machine backup, may also allow you to restore the item.

Avoid making additional changes until you identify the file and understand its purpose.

Hidden files are still not visible in a particular location

Some items may be protected by macOS, controlled by permissions, or hidden for reasons beyond Finder’s standard display preference. Finder may also display some system locations differently depending on your macOS version and security settings.

The Terminal ls command can show directory contents, including many hidden files, without changing Finder’s display preference:

ls -la

This command lists the contents of the current Terminal directory, including items whose names begin with a period. It does not reveal every protected system item and does not change any files.

Frequently Asked Questions

What is the shortcut to show hidden files on a Mac?

In Finder, press Command-Shift-Period ( + + .). Press it again to hide the files.

Does showing hidden files change or delete anything?

No. The keyboard shortcut changes Finder’s display behavior. The AppleShowAllFiles Terminal command changes a Finder preference. Neither method changes the contents of the files.

Where are hidden files stored on a Mac?

Hidden files can be located anywhere. Many user-related hidden items are in ~/Library, while macOS and applications may store hidden items in other system, application, or configuration folders.

How do I show the hidden Library folder?

In Finder, click Go in the menu bar, hold the Option key, and select Library. You can then use Command-Shift-Period to show hidden items within it.

How do I permanently show hidden files?

Run these commands in Terminal:

defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder

This changes Finder’s preference until you disable it.

How do I turn hidden files off again?

Use the Finder shortcut again, or run:

defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder

Can I use Terminal to list hidden files without showing them in Finder?

Yes. Open a Terminal window, navigate to a folder, and run:

ls -la

The command lists visible and hidden items in the current directory. It does not alter Finder or the files.

Should I delete hidden files to free up space?

Usually not without identifying them first. Some hidden files are caches or temporary items, but others store application data or system information. Use the relevant app’s supported cleanup tools or macOS storage recommendations instead of deleting unfamiliar files manually.

Final Thoughts

The easiest way to show hidden files on a Mac is to open Finder and press Command-Shift-Period. Use the Terminal preference when you want Finder to keep showing hidden items after the shortcut is no longer active:

defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder

When you finish, restore Finder’s normal behavior with:

defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder

Viewing hidden files is generally safe, but modifying or deleting unfamiliar items can affect macOS and your applications. Reveal only what you need, and keep a backup before making changes.