When you look inside a folder on a Mac, you see a collection of files and folders that can be acted upon — you can open files and folders, delete them, move them, and so on. But did you realize that there are also hidden files and folders on your Mac? These are usually files that are hidden from users for one reason or another — configuration data or system level files, for example. Advanced Mac users may need to view, edit, or delete certain hidden files and folders from time to time, so in this Tech 101 article we’ll show you just how easy it is to view those “invisible” files.
These files are hidden by one of several methods. First, a period ( . ) can be placed in front of the file name, which is used by the Finder to make the file invisible most of the time. Next, it can marked as hidden in Terminal using the chflags command. Finally, there’s the setfile command. In this article, we’ll go through two methods to view hidden files — changing the default settings for macOS so that the Finder shows all files all the time, and a keyboard shortcut that allows users to temporarily see hidden files.
Changing the Default Settings of macOS to Show All Files
This method of making all files visible to users requires familiarity with the Terminal app, which is found in the Utilities folder in the Applications folder. If you’re not comfortable using the command line and Terminal, then you may wish to skip ahead to the temporary method of viewing hidden files.
1) Launch the Terminal app
2) For all Macs running macOS High Sierra (10.13), Sierra (10.12), OS X El Capitan (10.11), OS X Yosemite (10.10) and OS X Mavericks (10.9), the following command string changes the default settings of macOS to show all files:
defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder
After typing after the Terminal prompt, press the Return key to change the defaults.
The following before and after screenshots shows the same “Computer” view before and after running the Terminal command. You’ll notice that all of the now-visible hidden files appear in a somewhat “transparent” format (see screenshots below):
The hidden files and folders can now be opened, modified, and deleted. However, it’s a bad idea to do so unless you know exactly what you’re doing!
Changing Back to the Default Settings
Now that you’ve had a quick look around your Mac with all of those invisible files, you’ll probably want to switch things back to normal. That’s done with the following Terminal command:
defaults write com.apple.Finder AppleShowAllFiles FALSE;killall Finder
You’ll notice that this is the same command that we used before, but the AppleShowAllFiles attribute is set to FALSE instead of TRUE.
Viewing Hidden Files on a Mac with a Keyboard Shortcut
Most users don’t want too see those hidden files all the time, but may occasionally need to view them. Rather than firing up the Terminal app and entering a command, this method uses a simple keyboard shortcut to make the hidden files appear.
1) In the Finder, open any folder where there might be hidden files. Good candidates for finding hidden files include the HD root directory, the Computer view (as seen in the screenshots in the previous section of this article), or in a user Home folder.
2) Press this combination of keys on your keyboard: Command – Shift – Period ( . )
3) This toggles the visibility of hidden files. Here’s a GIF of this keyboard shortcut in action, toggling between visible and invisible:
Remember, it’s a really good idea to NOT remove, modify or delete hidden files unless you know exactly what you’re doing. Many of the hidden files are configuration files for apps or are critical components of macOS, so changing or removing the files can affect the way your Mac functions.