Quick Look feature in OS X allows you to look at the file contents without opening the file up. Select file, press space and a Quick Look window will pop up.
This handy feature is made even better when text selection is enabled, so you can select and copy text from the file you are previewing.
To enable text selection, open terminal and type the following command:
defaults write com.apple.finder QLEnableTextSelection -bool TRUE; killall Finder