How To

How to Hide Files and Show Hidden Files on macOS Sierra

Written by John

If you have some private files that you would rather tuck away from prying eyes, then hiding them is one of the best options you have. The files will be made invisible so that people cannot stumble upon them and open them. Though this will not be enough to hide files from people who are knowledgeable about the issue, it is an easy way to stop curiosity from picking. So, how can you hide files on macOS Sierra and how do you show those hidden files when you need to.

Hiding files or Folders on macOS Sierra

Simply put, to hide a file or folder you will be required to set a hidden attribute for it. The procedure for hiding a file is exactly the same as that of hiding a folder. Here is a step by step guide on how to go about this.

1. Press Command and Space keys simultaneously. Type the word “Terminal” and press Enter. This opens a terminal window.

Search Terminal

Search Terminal

2. In the newly opened terminal window, type in the following command.

chflags hidden

Press the space key.

3. Drag the file or folder you would like to hide from the Finder and drop into the terminal window.

Hidden File or Folder on macOS Sierra

Hidden File or Folder on macOS Sierra

4. The path of the selected file/folder will be shown on the terminal window. Press Enter.

The path of the selected File and Folder

The path of the selected File and Folder

When this process is finished the file/folder will diaper from the finder and you will not see it by default.

Show All Hidden Files and Folder

You will need to access the hidden file or folder soon or later. Your best option is to use the Terminal application. Through this app, you will be able to use a command line to enter the UNIX commands. You will be able to access the MacOS Sierra and able to make changes to how it functions by default.To do this, follow the following steps.

1. To open the Terminal app, click on Go then Utilities then double click on the Terminal app

2. Input the following commands pressing Enter after every line:

defaults write com.apple.finder AppleShowAllFiles YES
killall Finder

Show All Hidden Files

Show All Hidden Files

3. Restart the Finder by pressing Option and Control buttons simultaneously. Click on the Finder icon in the Dock and choose Relaunch. You will only need to do this if the Finder does not restart automatically.

It is important to understand what the commands you just typed in instruct to the computer to do. The first line instructs the computer to show all files including the hidden ones on the Finder. The second command instructs macOS Sierra to close then reopen all the Finder Windows. This way, when the Finder relaunches, it has all the files and folders including the ones that had been hidden.

Unhide a File or Folder on macOS

1. To open the Terminal app, click on Go then Utilities then double click on the Terminal app

2. In the newly opened terminal window, type in the following command

chflags nohidden

Press the space key.

3. Drag the file or folder you would like to unhide from the Finder and drop into the terminal window then press Enter.

Unhide a File or Folder on macOS

Unhide a File or Folder on macOS

To sum it all up, though hiding files on macOS Sierra are not as straight-forwards as it is in Linux and Windows OS. With the above steps, you can enjoy privacy on your Mac without having to set up passwords which may prove challenging to remember all of them. Use of passwords is your only other option instead of hiding files and folders.

6 Comments

  • Hi, I’m having trouble with hiding really any type of file doing this. All the tutorials I’ve seen about how to hide files say the same: type ‘chflags hidden ‘ in terminal, drag and drop the file into terminal and push enter, but when i push enter nothing happens to the file, it still pops up on finder and spotlight and is completely visible, the only difference is that the icon goes a little dull but never disappears. Any tips?
    Thanks.

  • Hi, John, thanks for the tutorial. I’ve got a tangential question for which I’ve been searching for an answer with no success. I’m not very familiar with the Terminal, but your post and numerous others indicate that copying file path from Finder to Terminal is as simple as dragging and dropping. I’m using macOS Sierra 10.12.3, and for the life of me I cannot get that ostensibly simple action to work. No matter what file I try to drag and drop onto the Terminal, the pathname never appears in the Terminal — even when I first hold the file over the Terminal window for a few moments to ensure the Terminal app is in the foreground before then dropping the file on the window. I have even tried clicking option+copy [file] as pathname with a file selected in Finder and then tried all of the several paste options available from the Edit dropdown menu in Terminal, but still nothing does the trick. Am I missing something? Much thanks for any light you can shed.

Leave a Comment