Mac: Need to hide your secret diary or another file? You can do it with one terminal command on the Mac. If you want it back, the command to show it works just as easily.
To hide, just type this:
chflags hidden /path/to/file-or-folder
To unhide it, just change hidden to nohidden
chflags nohidden /path/to/file-or-folder
Don’t know the path or don’t feel like typing it? Just type the command and drag that file or folder onto the Terminal window and press enter. Your Mac will handle the rest.
OS X: Hiding Items with the Terminal [The Mac Observer]