It might seem like a simple question. But the answer isn't so simple — Linux isn't in a hurry to show its cards and reveal who it really is. From indirect clues we can usually say with a fair degree of confidence whether we're looking at Debian or RedHat. But, for example, telling apart CentOS, Fedora, or even RedHat itself, the progenitor — that you won't figure out right away.
Kernel version and other useful information
$ uname -a
Linux mylinux 2.6.32-5-bpo.5-xen-686 #1 SMP Wed Jan 19 03:19:48 UTC 2011 i686 GNU/Linux
As you can see — not a word about the distribution — only the kernel version and the hostname, as well as the architecture (AMD64 or traditional i386) and the installation date.
Distribution version and typeTo determine the distribution, look at one of the following files. One of them will tell you which Linux version and which distribution you're dealing with (which files are present depends on the distribution).
/etc/issue
$ sudo cat /etc/issue
Debian GNU/Linux 6.0 \n \l
/etc/*-release
$ sudo cat /etc/*-release
CentOS release 5.6 (Final)
That's about it.
Comments