Believe it or not, your Mac has many folders and files that are automatically hidden and you cannot see as readily available. This is done to keep safe the files that are crucial to the operation of your Mac, and it could be catastrophic if deleted or incorrectly modified. But what if you want to see these files?

There are a few reasons you might need to view hidden files. Luckily, you can easily show your hidden files via Terminal. Let’s get into how to do this, as well as how to hide and show individual files and directories.

Key Takeaways

  • Files that are automatically hidden by your macOS are usually hidden for the safety of your Mac. 
  • These files can be accessed using the AppleShowAll command in Terminal. 
  • You can also choose to hide your files using the chflags hidden command in Terminal. 
  • While hiding files can provide some privacy, it is not a substitute for proper encryption when dealing with sensitive information.

Showing Hidden Files or Folders on Mac via the Terminal

To help you avoid making accidental changes to any of these files or folders, macOS hides certain files from you. Fortunately, it also provides a way for you to show them when you do need to access a hidden file or folder.

You can also hide specific folders that aren’t system files — but rather files that you would just like to keep away from prying eyes. Please keep in mind, however, that this is not a security feature, and any folders with proprietary or sensitive information should be encrypted appropriately to keep them as safe as possible. 

Hide All Files and Folders

If for whatever reason you need to see the files or folders that Mac hides automatically, we can use Terminal to make them appear in your Finder. 

Take the following steps to do this:

Step 1: Open Terminal on Mac using Launchpad (or any other method that you prefer).

Step 2: Before we begin, note that my folder looks like this, with no hidden files shown.

Step 3: Using Terminal, type the following command:

defaults write AppleShowAll Files true

Hit Enter.

Step 4: At the new command line, type the following command: 

killall Finder

Step 5: Finder will then relaunch and look like this with all the light gray files and folders being the folders that are typically hidden. 

Rehiding All Files/Folders

Luckily, Apple makes it very easy for us to rehide the files. The command is the same but uses ‘false’ instead. Take the following steps to hide your folders again:

Step 1: Reopen Terminal if you have closed it. 

Step 2: Using Terminal, type the following command:

Defaults write AppleShowAll Files false

Step 3: Hit enter

Step 4: At the new command line, type the following command: 

Killall Finder

Step 5: Finder will relaunch and go back to hiding all the files.

Hiding Individual Files/Folders

If you would like to hide your personal files or folders, Apple provides us with that ability as well. 

Please note: if you plan to leave the file hidden, remember or write down the file path so that you can unhide it in the future. 

Using Terminal, enter the following command:

chflags hidden /YourFilePath

Press enter.

Note: to make things easier, you can drag and drop the file to the Terminal window after pressing the space to automatically populate the file path. 

Unhiding Individual Files/Folders

This is where it becomes important for you to remember your file path. When you are ready to unhide your file, you can do so by following this process. 

Using Terminal, enter the following command:

chflags nohidden /YourFilePath

Press enter.

Note: If you do forget your file path, the method above to unhide all files will also pull up your personally hidden files.

Final Thoughts

If you ever need to access files that have been hidden by your Mac, or by your own choosing, luckily Apple provides ways for you to access these files. 

The AppleShowAll command is very helpful for you to be able to view any files that are hidden, especially ones that you may not know the direct file path for. You can also use the chflags hidden command to hide files of your own choosing. 

While hiding files is an easy way to keep them from being easily accessible, this should NOT replace proper encryption for files or folders that contain sensitive information. 

Do you unhide/hide your files on Mac? Did you run into any problems during this process? Let us know in the comments!