Show and hide Library and USER Library files and folders in OS X Mavericks 10.9

From OS X 10.9 Mavericks, 10.8 Mountain Lion and 10.7 Lion, the /Library and ~/Library are hidden from the Finder – to show these directories in the GUI, launch Terminal from /Applications/Utilities and run the command below with sudo and enter your admin password when requested:

To Unhide:
sudo chflags nohidden /Library/ ~/Library/

To Hide:
sudo chflags hidden /Library/ ~/Library/

Above command can be applied to any directories in the filing system to see the hidden contents of the private folder including /etc

e.g.
sudo chflags nohidden /private Or, sudo chflags hidden /private

chflags cannot be used to hide or unhide defined invisible files or folders folders that are preceded by a "."

To show all hidden files and folders, that start with a ".", back to Terminal in OS X 10.9 Mavericks:
defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder

To hide all hidden files and folders, that start with a ".", back to Terminal in OS X 10.9 Mavericks:
defaults write com.apple.finder AppleShowAllFiles -boolean false ; killall Finder

To show all hidden files and folders, that start with a ".", back to Terminal for earlier versions of OSX 10.8 and prior:
defaults write com.apple.finder AppleShowAllFiles TRUE ; killall Finder

To hide all files and folders, that start with a ".", back to Terminal for earlier versions of OSX 10.8 and prior:
defaults write com.apple.finder AppleShowAllFiles FALSE ; killall Finder