If you’ve used a Mac long enough, you’ve surely wondered how to hide a file. It could be important work documents you don’t want anyone to see, or something a bit more personal in nature. No matter what it may be, today we’ll talk about three solid ways to hide files on your Mac.
1. Using Terminal
First, we can use a simple terminalcommand to hide folders from prying eyes. Open the Terminal and enter the following command:
chflags hidden (Path to the file here)
Before pressing Enter, drag the folder or file in question to the Terminal and the path will show up. You can of course type the path manually as well. Just remember that if your folder/file has spaces, turn them into dashes first.
Now the contents of the folder are hidden. There are two ways to unhide them. You can either unhide the specific folder or do so for all hidden folders on the system.
Unhide Specific Location
To do so for just the folder we hid, use the following command:
chflags nohidden (Path to the file here)
If you’re coming back after a couple of days to unhide it and want a quick way to know the path for the file hidden, write the following command:
This will bring up all the commands you’ve typed. Copy the path name to the chflags nohidden command and press Enter.
Unhide All Hidden Folders
To unhide all hidden folders, type the following command:
defaults write com.apple.finder AppleShowAllFiles TRUE
If you’re using a Mac that’s running Mountain Lion or below, you’ll have to capitalize the F in com.apple.finder.
To hide all the files again in the same fashion, use the following command.
defaults write com.apple.finder AppleShowAllFiles FALSE