How to Show Hidden Files in macOS

To show hidden files on a Mac, use the Terminal application. The command lines accomplish two goals. The first part changes the file setting to show hidden files. The second part restarts the Finder so the files show up. If you use OS X 10.8 or earlier, enter this command instead:
Most of the time, you want to keep these hidden files and folders out of view, but there are circumstances where you may want to see them. For example, malware and viruses can cause problems by altering system files or renaming important folders. In such cases, you need to manually change those files back, and you can’t do that if they are invisible. Keep in mind 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 look quite different.

How to Hide Files in macOS

When you’re finished with the hidden files and folders, it is a good idea to return those files to their hidden state. Reversing the process of revealing hidden files, returns the files to a hidden state, and the Finder restarts to reflect the change. If you’re using OS X 10.8 or earlier, enter this command instead:

A Word About the Terminal App

Using 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, you are essentially executing Terminal commands; the difference is that the commands have been automated and given a graphical presentation to make their operation more user-friendly.