Hide a File or Folder on Mac OS X

RELATED ARTICLE
A Windows User’s Guide to Mac OS X Keyboard Shortcuts
Keyboard shortcuts are essential for being productive on any device with a keyboard, whether it’s a Windows PC or a... [Read Article]
Macs also hide files and folders beginning with a . character. There’s also a special “hidden” attribute the Finder will obey. Hiding a file or folder is a bit more difficult on a Mac. Try to rename a file or folder so it begins with a period and the Finder will tell you “these named are reserved for the system.” There’s also no way to quickly toggle the hidden attribute in the Finder’s graphical interface.
You can quickly mark a file or folder as hidden with the chflags command in the terminal. First, open a Terminal window by pressing Command + Space, typing Terminal into the Spotlight search dialog, and pressing Enter.
Type the following command into the terminal, but don’t press Enter:

chflags hidden
Be sure to type a space after “hidden.”
chflags-hidden-command-on-mac-os-x
Next, locate the file or folder you want to hide in the Finder. Drag and drop it to the terminal. The file or folder’s exact path will appear in the terminal.
Press Enter to run the command. This will mark the file as hidden.
hide-a-file-on-mac-os-x-10.9-mavericks
Use the same command to unhide a file or folder in the future, using “chflags nohidden” instead of “chflags hidden”.

View Hidden Files and Folders on Mac OS X

Mac OS X has a secret keyboard shortcut to view hidden folders and files in any program’s Open or Save dialog. Just press Command + Shift + Period. Note that this only works in Open and Save dialogs — not in the Finder itself. However, this may be the most convenient way to quickly access your hidden files when you need them.
view-hidden-files-and-folders-with-keyboard-shortcut-on-a-mac
The Finder doesn’t have a graphical option for viewing hidden files and folders. Instead, you’ll have to use a command. First, open a Terminal window in the same way as above. Run the following commands on Mac OS X 10.9 Mavericks. These commands will set the Finder to always show hidden files and restart the finder so your changes will take effect. Type each command into the terminal and press Enter after each.
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
(On older versions of Mac OS X prior to Mavericks — 10.8 Mountain Lion. 10.7 Lion, and 10.6 Snow Leopard — use the same commands as above but change “com.apple.finder” to “com.apple.Finder” — the F here must be capitalized on these operating systems.)
view-hidden-files-and-folders-in-mavericks
The Finder will show hidden files. They’ll be partially transparent so you can see which files are hidden and which are normally visible.
hidden-files-and-folders-in-finder-on-mavericks
To hide files again, run the following commands in a terminal window:
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder
(On older versions of Mac OS X, remember to use “com.apple.Finder” instead).
disable-showing-hidden-files-and-folders-in-finder

To actually prevent people from accessing your secret files and folders, you’ll want to encrypt them instead. Files and folders hidden in the above ways are accessible with a few clicks — they’re hidden from view, but easy to find if someone goes looking for them. Encryption ensures your files and folders can’t be accessed unless someone has your encryption key.

Share this

Related Posts

Previous
Next Post »