查看Linux系统版本信息记录

in 互联网技术 with 0 comment  访问: 3,260 次

这是个很常识性的知识点,只不过不同的发行版本有所不同,也可能有的命令没有,不过你想查看到你想看到的信息,总有一个是有的,这里我记录一下,也方便自己以后使用。

No.1 查看内核版本信息

方法一:

[root@labhost1 nock]# cat /proc/version 
Linux version 2.6.32-431.11.5.el6.ucloud.x86_64 (root@10-9-1-160) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Thu Jul 3 09:42:34 CST 2014

方法二:

[root@labhost1 nock]# uname -a
Linux labhost1 2.6.32-431.11.5.el6.ucloud.x86_64 #1 SMP Thu Jul 3 09:42:34 CST 2014 x86_64 x86_64 x86_64 GNU/Linux

No.2 查看系统版本信息

方法一:

[root@labhost1 nock]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m

查看/etc/issue 这种方法使用于所有的Linux发行版本系统。

比如debian:

root@debian9:~# cat /etc/issue
Debian GNU/Linux 9 \n \l

方法二:

[root@labhost1 nock]# lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.5 (Final)
Release:    6.5
Codename:   Final

这个命令适用于所有的Linux发行版,包括Redhat、SuSE、Debian等发行版,不过可能你的系统没有这个命令,安装如下所示:

yum -y install redhat-lsb-core

方法三:

[root@labhost1 nock]# cat /etc/redhat-release
CentOS release 6.5 (Final)

此命令使用RedHat系的操作系统,RedHat、Centos均可。

WeZan