macOS contains many hidden files that you as a normal user will not see. This concerns system files such as .htaccess, .profile and .bash. These are very important files and hidden from view because modifying or deleting these files can cause serious problems.
If you know what you’re doing and you need a certain hidden file, it’s useful to know that you can display those files via Terminal. The steps below explain how to make them visible.
Show hidden files on a Mac
- Open Terminal via Apps â–¸ Utilities
- Copy the command below (command⌘ + c)
- Paste the command into an empty window (command⌘ + V)
- Press enter to execute the command
$defaults write com.apple.finder AppleShowAllFiles TRUE;killall Finder
After executing the command, Finder will restart automatically. Then you can immediately view all hidden files. You can recognize them by their transparent look.

Be careful when removing
Again, don’t delete files without knowing what you are doing. Deleting certain files can cause macOS to no longer function properly. A complete recovery of your Mac is then necessary, which may be possible without losing any data.
Hide transparent files
Once you have finished editing the files and tasks you wanted to perform, it is advisable to hide the ‘hidden files’ again. You can do this by executing the command below in Terminal.
$defaults write com.apple.finder AppleShowAllFiles FALSE;killall Finder
Show hidden files with a key combination
Since macOS Sierra you can also display the hidden files with a key combination instead of a difficult terminal command. Open Finder and press the keys shift⇧ + command⌘ + . (period) simultaneously. The files will be displayed immediately. You can hide them again using the same combination.