How to View Hidden Files on Mac [Including How to Hide]

There are hidden files on both Windows and Mac systems. Normally, the invisible files and folders can be divided into two categories: files hidden by the system and files hidden by users themselves.

how to view hidden files on mac

It is easy to see hidden files on Windows systems like Windows 11 and Windows 10. While Mac may be strange to many users because macOS system design is quite different from Windows. This article will help you understand hidden files on Mac from two main aspects.

You can get the hang of different ways about how to view Mac hidden files from this article:

How to Show Hidden Files With Shortcuts

How to Use Terminal to View Hidden Files

How to Hide and Show Photos, Folders on Mac Desktop

Why are Some Hidden Files Showing Up Suddenly on My Mac?

If you want to hide your photos or important documents, you can also:

Set Visible Files/Folders to Invisible

Create Hidden Folders in Mac Finder

Put Files/Folders to the Hidden Folders

Show Mac Hidden Files (System Files and Users Files)

Normally, macOS systems will hide important system files to prevent them from being accidentally deleted and thus damaging the system. However, in some cases, you may need to check hidden files on the Mac.

For example, when you are browsing the “Library” folder and clearing out old logs, caches, or other junk files, you need to show the hidden files to select which files are to be deleted.

However, many users do not know the Finder’s system directories, not to mention know where to view these hidden folders. In this case, a viable method is to show display all system directories on the left side of the Finder.

1. Open Finder > Preference.

2. Under Sidebar, check the boxes of your username (of Mac) and Hard disks.

Here, you can also check the boxes of all options.

finder show users and hard disk

3. In Finder, you can see the folders of your username and hard disks on the left side.

How to Show Hidden Files with Shortcuts

In fact, Mac system hidden files are divided into system hidden files, program hidden files, and user hidden files, which can be directly shown by shortcut keys.

Open Macintosh HD on the left side of Finder, and you can see four folders, which are Applications, Library, System, and Users.

In any folder in Finder, hold down the shortcut Command + Shift + .(dot), and you will notice that many invisible files, folders, and shortcuts appear in the folder, which is Mac hidden files and folders.

macintosh hd hidden files folders

Above are system hidden files of Macintosh HD.

users hidden files folders

Above are the user hidden files, including files in Library, cache files, and files in trash.

Besides, if there are hidden folders under Documents, Downloads, Pictures, etc., they will also show up.

Now you can open these hidden folders one by one to see what’s inside. MacBook hides these files in case you deleted them and caused system crashes. Therefore, if you want to edit or delete them, back them up in advance.

If you want to re-hide these files, just press Command + Shift +. (dot) again combination key, and you will notice that the folders that appeared before are hidden.

User Terminal to Show Hidden Files

Of course, it seems a more advanced method to use the command to see hidden Files. This method will take effect for all files on disk except desktop files and folders.

1. Open Terminal from LaunchPad or Spotlight search.

2. In Terminal, enter the following command and then press Return to run the command.

defaults write AppleShowAllFiles -boolean false ; killall Finder
show mac hidden desktop files

After that, you’ll notice that a folder pops up on your desktop, which is the username folder. And all files and folders including those hidden ones are visible.

The Terminal code to hide Files

Now that Mac files can be shown using a command, you can use a terminal code to hide these files. If you want to hide system files, you can run the following command in Terminal:

defaults write AppleShowAllFiles -boolean ture ; killall Finder
terminal show hidden files

Note: When you are executing the command, you may observe that the desktop icons disappear suddenly and then re-appear again. Do not worry! That is a normal phenomenon.

Use Terminal to Show and Hide Desktop Files and Photos on Mac

If you are a Mac veteran, you are unable to hide Mac desktop pictures or files by configuring some settings. There is only an option, Stacks, provided by Mac to help you organize the desktop to simply desktop arrangement.

However, Stacks cannot allow users to hide desktop images and documents. Especially, when there are too many files on the Mac desktop, Stacks appear less powerful to deliver users’ expectations about file management.

In this case, many users tend to use third-party tools such as Alfred Workflow or HiddenMe (Free or Pro) to view or hide Desktop icons. While it’s easy to set up these programs, many users don’t like third-party tools. In this way, you can use terminal commands to show and hide MacBook desktop files.

Hide Mac Desktop Files Code:

defaults write CreateDesktop -bool false; killall Finder
hide mac desktop files

Show Mac Desktop Hidden Files Code:

defaults delete CreateDesktop; killall Finder
show mac hidden desktop files

Why are Some Hidden Files Showing Up Suddenly on My Mac?

Some users found gray files when they opened the Macintosh HD on their desktop (like file,. VolumeIcon.icns) or folders (bin, cores, private, and usr). So, why do these Mac desktop files pop up abruptly?

One reason might be that the user accidentally pressed Command + Shift +. (dot) in the Finder to show hidden folders. While another reason may be that you have upgraded or modified the macOS system.

If so, you can use shortcuts or commands to hide these Mac files again.

Besides displaying Mac system hidden files, you may need to hide private photos, documents, or folders. Follow the method below to do so.

Further: How to Hide Photos, Documents, and Folders on Mac?

Actually, hiding files is just a way to protect them by making them invisible under certain conditions. If you want to hide your private files as you do on Windows, you can do so in the following way.

Set a Visible Folder to Invisible on Mac

You may just want to set some files invisible. For instance, you want to hide essential photos and documents under Documents, Music, Pictures, and Downloads in Finder.

Below is an example to hide the Photo folderunder Finder Pictures:

1. Open Terminal.

2. Enter the following command and end it with a “blank space”. Please do not hit Return here.

chflags hidden

3. Drag the folder you want to hide into the Terminal space, and it will automatically generate the file path.

set visible photo to invisible


Make sure the path is accurate when you are dragging the folder to Terminal. Otherwise, if there is a blank space or special characters in the folder, Terminal may recognize it as other paths.

3. Hit Return.

4. Open the Pictures directory in Finder. You will notice that the “Photos” folder disappears since it is hidden.

If you want to see the hidden folder, just hold Command + Shift +. (dot) to view the invisible folder.


Chflags is a command to change the attributes of hidden files, and Chflags represents “change flags”, which refers to changing marks or symbols of files.

In this way, chflags hidden means to hide files. If you want to show hidden files, you can run the command of “chflags nohidden”.

Create Hidden Folders in Finder

In addition to changing the attribute of existing files to “hidden”, another way is to create a hidden folder in the first place to store the photos and documents. This method can be achieved from Terminal.

Below is an example of how to create a hidden images folder called Beaphoto.

1. Open Terminal.

2. Enter the command “mkdir Pictures/.beaphoto”, and then press Return to run the command.

In fact, the command is “mkdir file location/.file name”, so you need to change it according to the file name.

create hidden photo folder

3.Open Finder > Pictures. You can find an invisible folder named beaphoto, and then you can drag files that you want to hide to this hidden folder.

beaphoto hidden folder

4. Press Command + Shift + .(dot) to hide the created folder.

Place Hidden Files in Hidden Folders

Sometimes, after you took photos or received essential documents, you may want to hide them and put them in hidden folders.

As mentioned, there are many hidden folders on Mac like bin, private, username folder, Library. So, you can just drag your photos or documents to these folders. Here, you should avoid naming these files the same names as the original files in these folders in case of file covering.

However, this method may not be suitable for users who do not want to find the private files in system hidden folders.


The attribute to hide files can be an option for users who want to protect the files or prevent misoperation, whether this is a system file or user picture or document, or downloaded file.

Meanwhile, it is foolproof to show hidden files and hide files using the shortcut. As this article suggests, you can also encrypt your folders if necessary.

More Articles:

How to Cut and Paste Files on Mac

How to Select Multiple Files on Mac

How to Uninstall Programs Completely on Mac

Brian Peng
Brian Peng is a PC technician and network engineer with over 13 years of IT experience. He has worked in the IT industry for a long time, providing IT support and network service support for various companies. Currently, he has written over 1000 articles about computers, games, and mobile.

Leave a Response