Contents
The macOS offer a method for hiding files and folders, just like other operation systems. However, Apple wants to keep these files and folders hidden away from prying eyes by default, so you can’t make it as easy as it is on Windows or Ubuntu. This guide will help you who just want to show/hide files or folder on Mac OS X or macOS Sierra by using the Terminal app.
How to Hide Files and Show Hidden Files on Mac [Quick Table]
Terminal | Note | |
Show Hidden Files and Folders | defaults write com.apple.finder AppleShowAllFiles YES killall Finder | Press Return after each line |
Hide Hidden Files and Folders | defaults write com.apple.finder AppleShowAllFiles NO killall Finder | Press Return after each line |
Hide a File or Folder | chflags hidden […] | […] = The path of the file or folder |
Unhide a File or Folder | chflags nohidden […] | […] = The path of the file or folder |
How to Show Hidden Files and Folders
Using the Terminal is the easiest method to show hidden files or folders in macOS.
Follow these steps below:
Step 1: Open the Terminal
To open Terminal, just go to the Finder and then click Go >> Utilities.
A new window appears, you can see the Terminal app, just double-click on it.
You can also go to LaunchPad >> Find the Others >> Click on Terminal.
Step 2: Use the command lines
Now, you can copy and paste the two lines listed here into Terminal, and hit Return after each line:
defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder
or
defaults write com.apple.finder AppleShowAllFiles YES killall Finder
If the last line doesn’t work, you need to relaunch the Finder by pressing and holding Option + Control and clicking on the Finder icon in the Dock, then click on Relaunch.
Now go to the Finder by clicking on its icon in the Dock, you are going to view the hidden files.
It’s like the image below:
Step 3: Exit the Terminal program
Select the Quit Terminal option from the Menu or press Command + Q.
Read Also: How to take screenshots on Mac
How to Hide Hidden Files and Folders
Step 1: Open the Terminal
Step 2: If you want to hide hidden files and folders, you can simply use the following command line below.
defaults write com.apple.finder AppleShowAllFiles NO
killall Finder
or
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder
The result.
How to Manage Individual Hidden File and Folder
Hiding a File or Folder
The simplest method to multiple hidden files that change a unique attribute on the file known as a Finder flag. You are able to easily set a file, folder as hidden using the “chflags” command line in the Terminal.
Just open the Terminal and type the following command line:
chflags hidden
Make sure to type a space after “hidden”.
Then Drop and Drag the wanted file or folder to the Terminal window. Hit Return to run the command.
This is going to set the file as hidden.
Opening a Hidden File or Folder
To access the hidden file from the Finder, you can click the Go menu in the Finder and select Go to Folder.
Put the path of the file into the dialog box and click Go or press Enter. The ~ means your user directory, so if you’ve had already a directory named like HiddenFolder on your Document, you just enter: ~/Desktop/HiddenFolder.
Open the folder which was hidden recently from Desktop
Open the folder which was hidden recently from Disk
Note: If you aren’t sure the path of folder or file, you can open the Terminal and drag the folder into it. Then, you can see the path immediately.
Unhiding a File or Folder
To unhide a file or folder, just copy and paste the following command into the Terminal, including a space in the end.
chflags nohidden
If you keep in mind the correct path of the folder or file, you can type it inside the Terminal. If you are not sure, just use the above tip to show hidden files and folder in the Finder and then drag the hidden file or folder into the Terminal.
Hit Enter later and the file or folder will come to be unhidden, so you are able to open it as normal.
More Tricks: You can press the Up or Down arrow button from your keyboard to see the command line which you’ve used.
There are some apps that allow you to use a hotkey for hiding or showing hidden files and folders on Mac, but we highly offer the Funter which is a free application to operate hidden files and folders.
This app integrates to your Finder, and adds own command to the context menu, so you can easily change file hidden attribute just from Finder with two steps.
[…] terminal is a useful program that can allow you change the Setting, opening any application, show hidden files and folder, etc. The good new is you can simply open the Terminal by using three ways including Finder, Launch […]
[…] Real Also: How to Show Hidden Files and Folder on Mac […]
[…] Read also: How To Show Hidden Files on Mac […]
[…] Read also: How to Show Hidden Files & Folders on Mac […]
[…] How to Hide and Show Hidden Files, Folders on macOS […]
[…] Read also: Quickly Show/Hide Hidden Files on Mac […]
[…] folder is the folder on your Mac that is hidden by default as it contains some files that Apple thinks its users should not be touching. These files are […]
[…] thing to keep in mind is that this method won’t hide your files from someone who really knows their way around a computer, but if you are surrounded by beginners, then this is […]
[…] the display setting to Column view (by clicking the icon of the rectangle with lines) shows the file […]
[…] have been leaving gigabytes of old preferences, hidden files, and extra junk files on your hard disk if you don’t remove them in the right way. This guide […]