Quickly Hide a File in Mac OS X Using Chflags

by Vickram H 2012-09-07 18:28:26

Quickly Hide a File in Mac OS X Using Chflags:

Want to quickly hide a file from prying eyes? Just like you can hide folders, you can hide individual files too. Here is how to do this using the command line tool chflags.

Launch Terminal from /Applications/Utilities/ and use the following command syntax:

chflags nohidden /path/to/hide/file.txt


If you know the path to the file just type it yourself. If you don’t, follow the drag & drop method to automatically type the entire path within the Terminal, just be sure to drop it in after the initial command, and then hit the return key:

chflags hidden [DRAG FILE HERE]


Note these files will be hidden to everyone unless if hidden files are shown in the Finder.

At any point you can unhide the file with the following chflags command:

chflags nohidden /path/to/hide/file.txt


chflags should be familiar to anyone who has used it to show the Library folder in OS X Lion or Mountain Lion. This is trouble-free alternative approach to the setfiles method, which requires Xcode Developer Tools to be installed to use. You can also throw a period in front of a file or folder name to hide it from the Finder in OS X.
1012
like
0
dislike
0
mail
flag

You must LOGIN to add comments