How to create hidden folders / files on Mac and show / hide them

Updated : Mar 14, 2023

I will explain in detail how to create “hidden files” and “hidden folders” on Mac, and how to use the shortcuts and terminals to show / hide them using illustrations.

スポンサーリンク

What are “hidden files” and “hidden folders” on Mac?

On Mac, folders and files whose names start with “. (Period)” are “hidden folder files” and are not normally displayed.

“Hidden folders and files” store data automatically created by macOS and apps, and are hidden to prevent users from accidentally erasing them.

Mr. Otter
Mr. Otter

This page will show you how to show / hide, but be careful not to accidentally erase the data!

Because even hidden folders and files can be easily deleted when they are displayed!

スポンサーリンク

3 methods to show / hide hidden folders and files

Here, I will introduce three methods, but for normal use, I recommend method ①, as which is easy to operate.

MethodAdvantagesDisadvantages
① Keyboard shortcuts・macOS standard function・Nothing special
② Execute commands
in “Terminal.app”
macOS standard function
・Can be incorporated
into programming
such as scripts
・It takes more time
than ①
③ Free app “Onyx”・Multifunctional・Need to install
スポンサーリンク

① How to use keyboard shortcuts

▶ On your keyboard, press shift + command ⌘ + . at the same time.

Each time you press them, you can show or hide hidden folders and files.

Mac US Keyboard
Click to enlarge

When hidden folders and files are displayed, they are displayed in a lighter color than usual.

【Hidden folders / files are hidden】

macの隠しフォルダ・ファイルの切り替え

【Hidden folders / files are displayed】

macの隠しフォルダ・ファイルの切り替え

This is the end of the explanation, “① How to use keyboard shortcuts”.

スポンサーリンク

② How to execute commands in “Terminal.app”

▶ In the “Applications” -> “Utilities” folder on the Finder, double-click “Terminal.app” to launch.

Mac Finder "Terminal.app"

▶ When the terminal starts, enter or copy and paste one of the following commands.

These commands are rewriting the Mac’s configuration file.

【Switch to display】

defaults write com.apple.finder AppleShowAllFiles TRUE

【Switch to hide】

defaults write com.apple.finder AppleShowAllFiles FALSE
<meta charset="utf-8">Mr. Otter
Mr. Otter

Copy and paste is recommended to save command input mistakes and troubles!

Below is the copy and paste of the command to the terminal.

Click to enlarge

▶ After entering or copying and pasting the command, press return on your keyboard to execute the command.

Mac US Keyboard
Click to enlarge

The following is the execution result.

Mac "Terminal.app"
Click to enlarge

▶ To load the settings so far on your Mac, execute the command to restart the Finder.

You don’t need to restart your Mac.

Type or copy and paste the following command, then press return on your keyboard to execute it.

killall Finder
<meta charset="utf-8">Mr. Otter
Mr. Otter

This command is also OK with copy and paste!

Below is the copy and paste of the command to the terminal.

Mac "Terminal.app"
Click to enlarge

▶ The Finder will be restarted and the settings will be reflected.

Close the terminal with the above.

<meta charset="utf-8">Mr. Otter
Mr. Otter

If we search online, there are many sites that explain the above methods.

Little devil fox
Little devil fox

Well then, let me give you some other lesser-written information.

How to hide hidden folder and files, that is, restore the defaults.

<meta charset="utf-8">Little devil fox
Little devil fox

The following procedure makes use of deleting the hidden folder / file configuration file to return to the default state.

▶ Type or copy and paste the following command, and press return on your keyboard to execute.

defaults delete com.apple.finder AppleShowAllFiles

▶ After executing the above command, in order to reflect the settings on the Mac, enter or copy and paste the following command and press return on your keyboard to execute.

killall Finder

This is the end of the explanation, “② Execute commands in Terminal.app”.

スポンサーリンク

③ How to use free app “Onyx”

You can switch between showing and hiding hidden folders and files with “Onyx”, a standard and well-established system setting app for Mac.

See the related article below for how to install “Onyx”.

The following is an explanation assuming that Onyx has been installed.

I’m also using Onyx version 4.1.3 for macOS 12 Monterey.

Mac Onyx

The procedure is explained below.

▶ After starting “Onyx”, operate in the order of ① to ③ below.

  • ① Click the tab “Parameters” at the top
  • ② Click the tab “Finder”
  • ③ Check the item “Show hidden files and folders”
Mac Onyx
Click to enlarge

▶ When Onyx displays a restart warning as shown in the screen below, check that there are no unsaved files or operations in progress, and then click the “Continue” button.

Mac Onyx

▶ When the Finder is restarted, showing / hiding hidden folders and files is complete.

This is the end of the explanation, “③ Free app Onyx”.

スポンサーリンク

Appendix: How to create hidden folders and files

If the hidden folders and files are hidden (default state), the hidden folders and files cannot be created.

Therefore, first, refer to “3 methods to show / hide hidden folders and files” explained in the above part, and make the hidden folders / files visible.

Then, when creating a file or folder, you can create a hidden folder and file by prefixing it with “. (Period)”.

At the time of creation, the warning will appear as shown in the screen below, but you can create it by clicking the “OK” button.

Mac Finder Warning

By the way, if the hidden folders and files are hidden (default state), the following error will occur.

Mac Finder Warning
Spa cat
Spa cat

This is the end of this article.

コメント

PHP Code Snippets Powered By : XYZScripts.com
Copied title and URL