How To Hide/unhide Files and Folders on macOS?
Hiding files and folders on macOS is not a proper security replacement However it is a security measures which must be taken by every macOS users. For instance to protect your online accounts, always a strong password is recommended since it is hard to decrypt. Also, it is never a good idea to use your birthday date, names or someone special in your password because anyone can guess it. Similar to that, hiding files and folders in macOS is a bit hard for a basic user However if you think smartly, even the average macOS user will not be able to see your hidden files (You will find out by reading to the end). Anyway, let’s start the process of How To Hide/unhide Files and Folders on macOS.
How to hide files and folders on macOS using Terminal?
Launch the terminal in any way that seems fit to you but I’ll be using a spotlight.
Execute the below command in the terminal and make sure to replace the path with the directory or the file name. The easiest method is to simply drag the file or the folder into the terminal, this will automatically mention the file path in the terminal.
chflags hidden path
Note: If using the mentioned command, the file is not hidden, you can use this command: chflags hidden ~/path
Hide Files and Folders on macOS using GUI
- Navigate to the file or folder that you want to hide.
- Following that right click on the file or folder then choose Get Info.
- Go to the General Tab.
- Check the box next to hidden in the Attributes section.
- Go ahead and close the Get Info window.
How to unhide files and folders on macOS using Terminal? (Temporarily)
There is actually a very simple shortcut that you can use to unhide files and folders on MacOS and the shortcut is Command + shift + .
You’ll have to execute the below command to unhide files and founders with terminal.
defaults write com.apple.finder AppleShowAllFiles YES
Also, if you wish to hide the those items again, you can easily execute the below command.
defaults write com.apple.finder AppleShowAllFiles NO
How to Permanently unhide Files and Folders on macOS?
- First, you have to view the hidden files temporarily by pressing the shortcut keyboard (Command + shift + .) or using terminal.
- Next you will have to launch the terminal and execute this command (chflags nohidden path)
You can drag the file or folder into the terminal and the path will be mentioned.
chflags nohidden path
- Change Keyboard Shortucut: Hiding Files and folders in your macOS with this technique is not a full proof protection. Even if you have hidden all of your important files, just by pressing the keyboard shortcut of (command + shift + .) , the hidden files will appear. However if you think smartly you can change the keyboard shortcut to something else so that only you know. Next time if anyone presses that (Command + shift + .), it will open something else.
- Use third-party apps: Using third party applications is one of the techniques which is likely better than terminal to secure your hidden files. For instance onyx from the titanium software, do a pretty solid job. Other apps such as Concealer, secret folder are also a good choice.