How to check kernel, architecture, and release (distribution) information on Linux
Kernel and architecture
The uname command-line utility can be used to check the kernel and architecture of a machine running Linux:
uname -a
... resulting in output like:
Linux ubuntu 2.6.20-16-generic #2 SMP
Tue Feb 12 05:41:34 UTC 2008 i686 GNU/Linux
This output specifies the operating system ("Linux"), nodename on the network ("ubuntu"), kernel version ("2.6.20-16-generic"), and architecture ("i686"), but it doesn't specify the operating system's release information.
Red Hat, Fedora, and CentOS Release Info
To check the release information in Red Hat Enterprise Linux, Fedora, or CentOS, run the following command:
cat /etc/redhat-release
... resulting in output like:
CentOS release 4.8 (Final)
SuSE Release Info
To check the release information in SuSE, run the following command:
cat /etc/SuSE-release
... resulting in output like:
SUSE LINUX 10.0 (X86-64) OSS
VERSION = 10.0
Debian Release Info
To check the release information in Debian, run the following command:
cat /etc/issue
... resulting in output like:
Ubuntu 7.04 \n \l
Ubuntu Release Info
To check the release information in Ubuntu, run the following command:
cat /etc/lsb-release
... resulting in output like:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.04
DISTRIB_CODENAME=feisty
DISTRIB_DESCRIPTION="Ubuntu 7.04"
Other Distributions
If you're unsure which of the above commands you should use, the following command will tell you the name of the file that contains the operating system's release information:
find /etc -iname "*release*"
... resulting in output like:
/etc/lsb-release