Here is the command which will give you OS name with version along with other detail information.
cat /etc/*release*
Example: On my ubutnu machine, It shows me.
cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.10
DISTRIB_CODENAME=intrepid
DISTRIB_DESCRIPTION="Ubuntu 8.10"