In OS X, we don’t see file extensions by default. However, in a number of environments it’s very useful to have them. To see them in the Finder, send a boolean AppleShowAllExtensions key to the NSGlobalDomain as True, then restart the Finder.
defaults write NSGlobalDomain AppleShowAllExtensions -bool true; killall Finder
To change back to not seeing extensions:
defaults write NSGlobalDomain AppleShowAllExtensions -bool false; killall Finder