a] /etc/*-release file.
b] lsb_release command.
c] /proc/version file.
查看你使用的版本:
$ cat /etc/*-release
下面是RHEL v5.x server的输出样例:
Red Hat Enterprise Linux Server release 5 (Tikanga)Ubuntu Linux v7.10输出的样例:
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=7.10 DISTRIB_CODENAME=gutsy DISTRIB_DESCRIPTION="Ubuntu 7.10"
lsb_release能显示Linux的发行版本和基于什么系统LSB (Linux Standard Base)
$ lsb_release -a
输出示例:
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 6.0.1 (squeeze) Release: 6.0.1 Codename: squeeze
使用下面的命令:
$ uname -a
或者
$ uname -mrs
输出:
Linux 2.6.32-5-amd64 x86_64
|
在这里,
下面的命令也可以查看kernel版本和gcc版本:
$ cat /proc/version
示例
Linux version 3.2.0-0.bpo.1-amd64 (Debian 3.2.4-1~bpo60+1) (ben@decadent.org.uk) (gcc version 4.4.5 (Debian 4.4.5-8) ) #1 SMP Sat Feb 11 08:41:32 UTC 2012