How to hide folders and files or show hidden folders and files in MAC OS X

macOS has the ability to hide folders and files, just like other operating systems.But macOS hides

These options and does not allow you to do it as easily as on Windows, Linux.To hide a file or folder, you'll need to set the"hidden" to him. The Finder and other Mac apps won't display thisDefault file or folder.

Hide folder or file

Instead of hiding an individual file (although you can do that), you can create a hidden folder. For the example we will do this,  this trick will also work to hide individual files.

At first, open a terminal window – Press Ctrl + Space, write Terminal and press Enter. In a terminal, enter the following command, including the space at the end of it:

chflags hidden

Drag the folder to the terminal window


The path to the file or folder will appear in the terminal. Press Enter to run the command and the file or folder will disappear. Finder won't show it by default.

Access hidden files or folders

How to access a hidden folder from Finder? The easiest way is to click on the menuGo toin Finder and selectGo to folder.


Type the folder path in the dialog box and press Go or Enter.~Means a custom folder, so if you have a folder named SecretStuff on your desktop, you'll need to enter~/Desktop/SecretStuff. If this were in the documents, you need to enter~/Documents/SecretStuff. They don't look at the fact that the folder is hidden andwill not display normally in Finder, you can quickly access it using this path. Any files you store in this folder are effectively hidden and no one can accidentally see them, but they will appear in the Finder if you browse to this directory in the manner described.

Show hidden files and folders in Open / Dialog

Graphic inclusion option - you must enableuse the terminal command and restart Finder for the changes to take effect. To view hidden files in Finder, open a terminal window and execute the following commands in it by pressing the ENTER key after each of them:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall finder

This command tells Finder to showhidden files and then launches it. This will show all hidden files and folders. They appear partially transparent to distinguish hidden files and folders from normal – unconcealed.

Want Finder to stop showing hidden files and folders? Run the following command to disable this option and restart Finder:

defaults write com.apple.finder AppleShowAllFiles FALSE
killall finder

Make files or folders visible

Do you want to display files or folders?Run the same command as before, only changing “hidden” on “nohidden.” In other words, enter the following command in the terminal, followed by a space:

chflags nohidden

If you remember the exact path to the file or folder, youYou can enter it in the terminal. If you don’t remember, you can use the above trick to display hidden files and folders in the Finder and drag the hidden file or folder to the terminal, as you did before.

(You can also press the up key(witharrow) in the terminal and get the command you entered earlier. Use the left key to navigate to “hidden” and change it to ” nohidden “, and then press Enter.)

You can also hide files or folders,renaming them so that the name begins with “.”. However, Mac OS X won't let you rename files and folders from the Finder window, so you'll have to do it from the Terminal.