How to Hide Folders and Files on macOS

photo of author
stealth
Update:

When you need to hide folders and files on macOS, in this tutorial, you will learn step by step how to do it.

Whether you want to keep personal information away from prying eyes or keep sensitive documents and photos in a safer environment, there are various methods and techniques to hide files and folders on macOS.

How to Hide Folders and Files on macOS (Two Methods)

With the help of the Terminal utility, there are two simple methods to hide folders and files on Mac, without needing to be an expert in macOS and without installing applications.

Method 1: Add a dot (.) in front of the folder or file name

You can hide a file or folder by adding a dot in front of its name. For example, if you want to hide a folder named "Secret", you can rename it to ".Secret". To do this, open the Terminal utility and use the mv (move) command to rename the file or folder: mv (move)

For this tutorial, let's take the scenario where I want to hide the "Secret" folder located on the Desktop inside another folder named "ihowto.tips".

Secret Folder on macOS
Secret Folder on macOS

1. Open the Terminal utility and execute the command:

mv Secret .Secret

If you haven't navigated in Terminal using the "cd" command to the location where the folder you want to hide is located, you need to enter its complete path. A simple solution is to drag the folder into Terminal to automatically write the entire path.

Example from my scenario:

mv /Users/laurentiu/Desktop/ihowto.tips/Secret  /Users/laurentiu/Desktop/ihowto.tips/.Secret

After executing this command, the "Secret" folder will no longer be visible in "Finder" on macOS.

How to Hide Folders and Files on macOS
Hide Secret Folder

You won't be able to rename a folder with "." in front of its name through the traditional method in Finder.

“You can’t use a name that begins with a dot “.”, because these names are reserved for the system. Please choose another name.”

Rename Dot Folder
Rename Dot Folder

Method 2: Hide folders and files on macOS using chflags.

A second method is to add the attribute "chflags hidden” for the folder or file you want to hide on your hard drive. To do this, you will use the Terminal utility as well.

Open the terminal utility and run the command:

chflags hidden Secret_Folder

To make hidden files visible again, you can use the same command, replacing “hidden" with "nohidden".

Both of the above methods will help you hide folders and files on macOS using the Terminal utility.

How to View Hidden Folders and Files on Mac

If you have hidden folders and files that you want to see and access, open the Terminal utility and execute the two commands below:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
Show Hidden Folders on Mac
Show Hidden Folders on Mac

To hide files and folders again, replace the “TRUE" with "FALSE" in the first command line.

Related: How to hide apps on iPhone or iPad

Hidden files and folders can also be viewed from the Terminal utility using the command line: “ls -all".

Alternatively to the two methods above, you can hide folders and files on macOS with the help of third-party applications that you can download from the App Store, but we recommend caution.

I am happy to share my experiences in the field of computers, mobile phones and operating systems, to develop web projects and to bring the most useful tutorials and advice. I like to "play" on the iPhone, MacBook Pro, iPad, AirPort Extreme and on operating systems macOS, iOS, Android and Windows.

Leave a Comment