Post

How to Show Hidden Files on Mac Using Terminal

Learn how to reveal hidden files on your Mac using a simple Terminal command.

How to Show Hidden Files on Mac Using Terminal

Hidden files and folders on macOS are usually system files or files that the operating system hides by default to prevent accidental deletion. However, there are times when you may need to view these files. This guide will show you how to use Terminal to reveal hidden files on your Mac.

Step-by-Step Guide

1. Open Terminal

  1. Press Command + Space to open Spotlight Search.
  2. Type Terminal and hit Enter.

2. Run the Command to Show Hidden Files

To make hidden files visible, type the following command in the Terminal and press Enter:

1
defaults write com.apple.Finder AppleShowAllFiles true

This command updates the Finder preferences to show hidden files.

3. Restart Finder

After running the command, you need to restart Finder for the changes to take effect. Enter the following command and press Enter:

1
killall Finder

Finder will restart, and hidden files will now be visible.

4. View Hidden Files

Open any Finder window. You will see hidden files displayed with slightly transparent icons. These files are typically system files or configurations.

How to Hide Files Again

If you want to revert the changes and hide the files again, follow these steps:

  1. Open Terminal.
  2. Run the following command:
1
defaults write com.apple.Finder AppleShowAllFiles false
  1. Restart Finder with:
1
killall Finder

This will hide the previously visible hidden files.

Tips and Warnings

  • Be cautious when modifying or deleting hidden files, as they may be critical for macOS or applications.
  • If you’re not comfortable using Terminal, you can also toggle hidden files visibility in Finder using the keyboard shortcut: Command + Shift + . (period).

By following this guide, you can easily manage hidden files on your Mac. Remember to toggle the visibility back when you’re done to avoid accidental changes to system files.

☕ Support My Work

If you found this post helpful and want to support more content like this, you can buy me a coffee!

Your support helps me continue creating useful articles and tips for fellow developers. Thank you! 🙏

This post is licensed under CC BY 4.0 by the author.