Show/hide files in Mac OS X

Enter in terminal:

Show files:

# defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

or flag the file as not hidden

# chflags nohidden /path/to/file.txt

Hide files:

# defaults write com.apple.finder AppleShowAllFiles FALSE
# killall Finder

or flag the file as hidden

# chflags hidden /path/to/file