Show User Library Directory in Mac OS X 10.7 Lion & 10.8 Mountain Lion

I can’t believe I’m posting about Mac issues.

But here goes, just for my personal documentation. Not that I own anything Apple, but only because I have to use their products.

Show User ~/Library in OS X Lion & Mountain Lion
Launch Terminal from Spotlight or Launchpad -> Utilities, and enter the following command to show or hide the directory:
chflags nohidden ~/Library/
The users Library folder will immediately become visible again.

Hide User ~/Library in OS X Lion (default setting)
This returns to the default setting of hiding the user Library directory:
chflags hidden ~/Library
Changes take effect immediately again, and Library becomes invisible to the user.