Show Hidden Files and Folders on macOS

Critical system files may need to be "unhidden" to fix virus damage

Filing documents
erhui1979/Getty Images

By default, macOS hides critical system files and folders. These are hidden for good reason; if hidden files were visible all the time, the chances that a user might accidentally delete or change them and potentially create catastrophic system-wide problems (not to mention headaches) increases greatly.

How to Show Hidden Files on macOS

  1. Open the Terminal app. You can do this by clicking Spotlight and then search for the word "terminal."

  2. When Terminal is open, at the command line prompt type the following command at the terminal prompt if your system is running OS X 10.9 or later: defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder.

  3. Note: If you're using OS X 10.8 and earlier, use this command instead: defaults write com.apple.finder AppleShowAllFiles TRUE ; killall Finder.

The command lines accomplish two goals. The first part changes the hidden file setting to show files (showing all is now "true"); the second part restarts the Finder so the files will now show up.

Most of the time, you want to keep these hidden files and folders out of view, but there are some circumstances in which you need to see hidden files or folders. For example, malware and viruses can cause problems by altering system files or renaming important folders, causing them to no longer work until you fix them by manually change them back.

It's important to keep in mind that there are lots of hidden files and folders. If you show hidden files and browse through your files in a Finder window, the file list landscape will look a bit different with all of these "new" files now showing up there. 

Most of the revealed files are operating system and configuration files. These should not be deleted or modified unless you are absolutely certain of their roles.

A Word About the Terminal App

To reveal hidden files, you'll have to use the Terminal app that is available on all Macs.

The Terminal app looks like an old-school computer screen with a command line and all text. In reality, viewing Terminal is like peeking behind the windows and menus of the graphical user interface you're accustomed to. When you open an application, format a USB flash drive, or search your computer using Spotlight, for example, these are basically executed Terminal commands that have been automated and given a graphical presentation to make their use simpler.

How to Re-Hide Normally Hidden Files

When you're finished with the hidden files and folders you needed to see (such as fixing a problem caused by some malware), it is good practice to return those files to a hidden state.

  1. Open Terminal. If you are using OS X 10.9 or later, type the following command at the prompt: defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder.

  2. Note: If you're using OS X 10.8 and earlier, use this command instead: defaults write com.apple.finder AppleShowAllFiles FALSE ; killall Finder.

Reversing the process used to show the files, these commands now return the files to a hidden state (showing all is now "false"), and the Finder is restarted to reflect the change.

The instructions on this page only apply to Mac users. If you're on Windows, see how to show or hide hidden files and folders in Windows.