Exact command or process of elimination?

If you already know you’re running Ubuntu or CentOS but don’t know the version, see one of the following sections. If you don’t know that much, just use the process of elimination—run both commands until you find the one that works.

CentOS

To find the CentOS version, enter the following command in Terminal:

cat /etc/*release*

The following sample output shows you’re running CentOS 6.5 (you can ignore most of the output):