I know how to find Mac OS X version from GUI:
Apple Menu (top left) > About This Mac
Is there a Terminal command that will tell me Mac OS X version?
You have a few options:
Either will do what you need, and will have an output format that's parseable (if that's what you're after).
For older Mac OS's you can find useful information in Wikipedia.