1 of 5

A question very close to this one was posted on Unix.Stackexchange HERE Giles has a pretty complete | cool answer for the ways he describes.

cat /proc/version

Linux version 2.6.32-71.el6.x86_64 (mockbuild@c6b6.centos.org) (gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) ) #1 SMP Fri May 20 03:51:51 BST 2011

uname -a

Linux system1.doofus.local 2.6.32-71.el6.x86_64 #1 SMP Fri May 20 03:51:51 BST 2011 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/issue

CentOS Linux release 6.0 (Final)
Kernel \r on an \m

cat /proc/config.gz cat /usr/src/linux/config.gz cat /boot/config*

Though I did some checking and this was not very reliable except on SUSE.

# zcat /proc/config.gz | grep -i kernel

Release Files in /etc (from Unix.com)

  • Novell SuSE---> /etc/SuSE-release Red Hat--->/etc/redhat-release,
  • /etc/redhat_version Fedora-->/etc/fedora-release
  • Slackware--->/etc/slackware-release, /etc/slackware-version
  • Debian--->/etc/debian_release, /etc/debian_version
  • Mandrake--->/etc/mandrake-release
  • Yellow dog-->/etc/yellowdog-release
  • Sun JDS--->/etc/sun-release
  • Solaris/Sparc--->/etc/release
  • Gentoo--->/etc/gentoo-release

There is also a bash script at the Unix.com link someone wrote to automate checking.

Figuring out what package manager you have is a good clue.

rpm yum apt-get zypper +many more

Though this is by no means foolproof as the vendor could use anything they want. It really just gives you a place to start.