Very quickly, through some simple command lines, users are able to hide files and view hidden files in El Capitan.
Open Terminal (found in Finder > Applications > Utilities)
I. Show hidden files in finder
Use the following command lines.
defaults write com.apple.finder AppleShowAllFiles TRUE
To hide these files, change TRUE to FALSE
defaults write com.apple.finder AppleShowAllFiles FALSE
II. How to hide a file or folder in Mac OS X?
Firstly, enter the following command line.
chflags hidden [The direction of file or folder (you can drag and drop the file or folder into terminal window, then hit Enter)]
chflags nohidden [The direction of file or folder]