At command prompt type: lsb_release -a
I can verify this works with CentOS.
Here is the example output.
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:g
Distributor ID: CentOS
Description: CentOS release 6.4 (Final)
This does not work for all version of Linux. I also have a Gentoo server. I used the following to get the information.
Displays the following info.
Gentoo Base System release 18.104.22.168