Show and hide hidden files on mac


This should be a simple matter, but it troubled me so much.

Simply, you need to the followings, but be warned that there are slight incorrect version of command on internet, at least which didnt' work for me on Lion.

On Mavericks
[sourcecode language="bash"]
defaults write com.apple.finder AppleShowAllFiles TRUE
[/sourcecode]

On Mountain Lion
[sourcecode language="bash"]
defaults write com.apple.Finder AppleShowAllFiles TRUE
[/sourcecode]

Then

[sourcecode language="bash"]
killall Finder
[/sourcecode]

But personally, I wouldn't want to see all hidden files in Finder. Rather, in bash, I can
[sourcecode language="bash"]
ls -al

drwxr-xr-x+ 56 andrewchaa staff 1904 25 Oct 03:41 .
drwxr-xr-x 6 root admin 204 23 Oct 00:48 ..
-rw------- 1 andrewchaa staff 3 26 Oct 2011 .CFUserTextEncoding
-rw-r--r--@ 1 andrewchaa staff 39940 25 Oct 03:32 .DS_Store
drwx------ 2 andrewchaa staff 68 24 Oct 22:45 .Trash
...
[/sourcecode]