How to Show Hidden Files on Mac Terminal

Do you know that your Mac has hundreds of files that you may not even be able to see? Hidden files are all over your file system, and it’s possible you may be looking for one of them. You may not be able to find it because it is not visible by default.

If you’re trying to follow steps to fix a problem or change the configuration of your Mac and you are unable to find the specific file shown in those instructions, it could be that it is hidden. You can easily configure Finder using Terminal to see these files, or you can view them in Terminal.

My name is Eric, and as a software engineer, I have worked with many types of files and file systems. Hidden files can be a little tricky since you may not know they are there, but I can show you how to make them visible so that you can work with them if needed.

If you want to see how you can show them using Mac Terminal, keep reading, and I will provide a couple of different methods to do this.

Hidden Files are Everywhere

Hidden files are nothing new. They have been on computer and file systems forever. They are very common on Mac operating systems and almost all other operating systems as well. 

You will commonly find a number of them in your file system’s root or main directory, but they can exist anywhere in any folder. Most hidden files are system or configuration files that have something to do with your operating system or an application you have installed.

Once you learn how to make them visible, you will realize that there are many other files existing in your file system that you didn’t even know about. If there is a file you are looking for and can’t find, there is a chance it could be hidden.

See Hidden Files in Terminal

Suppose you just want to quickly see what hidden files are in a specific directory without modifying any settings to your system. In that case, you can easily do this with one simple command in the Terminal application. 

Using the ls command, you specify the -a parameter, which tells Terminal to list the files in the directory and to show all of them. Just follow the steps below.

Step 1: Open Terminal

Open LaunchPad and type Terminal in the search field at the top of the screen. You will then see the icon for the Terminal application—double-click on it.

Step 2: Navigate to the directory where you want to look for hidden files.

You can navigate to the directory or path you choose using the cd command.

Step 3: Type in the ls -a command.

ls -a

The output of the command shows all files and folders in that directory. The hidden files are the ones that begin with a period or dot (.).

Use Mac Terminal to Make Files Visible in Finder

Using the above method in Terminal works well if you just want to see hidden files in a particular directory, but if you want to see all hidden files everywhere on your file system, you might want to configure Finder so that it sees them no matter where you are looking.

Follow the steps below to configure Finder to show hidden files.

Step 1: Open Terminal

Open LaunchPad and type Terminal in the search field at the top of the screen. You will then see the icon for the Terminal application—double-click on it.

Step 2: Update the AppleShowAllFiles value to TRUE for Finder.

Type the following command in Terminal

defaults write com.apple.finder AppleShowAllFiles TRUE

Step 3: Kill (shut down) all Finder instances.

You will need to shut down the Finder application so that the new setting will take effect when it is restarted. Type the following command to kill Finder.

killall Finder

Step 4: Start Finder on your desktop.

Now when you start Finder it will show all hidden files.

You will see the hidden files which begin with a period or dot (.). They are also shown in a lighter or grayed-out color to distinguish that they are hidden.

Change the Setting Back

If you want to change the setting back so that hidden files are no longer visible in Finder, just use the same steps as above but set the AppleShowAllFiles value to FALSE instead of TRUE. So the command in Step 2 would now look like the one shown below.

defaults write com.apple.finder AppleShowAllFiles FALSE

FAQ

Here are some of the questions I often see when discussing hidden files on Macs. 

Why are Files Hidden?

The main reason files are hidden is as a safety precaution. These are usually files that are critical to your operating system, and they are hidden so that you do not accidentally modify them or remove them. Out of sight, out of mind. 

Can Folders be Hidden?

Yes, they can be. If the folder name starts with a period or dot (.), the folder will be hidden and will not show up unless you use the ls -a command or have Finder’s settings set to show hidden files and folders.

Is it Safe to Delete Hidden Files?

As with any file, you should never just delete them without knowing what they are or what they are for. Hidden files pose an even greater risk because these are usually critical system files that you should not delete.

Conclusion

As you can see, you can easily see hidden files using the “list all” command in Terminal, and you can also use Terminal to configure Finder to show hidden files. Be careful whenever working with them since they are often critical files to your system.

I hope the information above has helped you to view your hidden files. Please let me know if you have any questions or comments. I would love to hear from you.

Leave a Reply

Your email address will not be published.