查看Linux系統版本信息
一、查看Linux內核版本命令(2種方法):
1、cat /proc/version
2、uname -a
二、查看Linux系統版本的命令(3種方法):
1、lsb_release -a,即可列出所有版本信息:
這個命令適用於所有的Linux發行版,包括RedHat、SUSE、Debian…等發行版。
(但有的系統沒有安裝lsb_release命令,後附:lsb_release命令安裝)
2、cat /etc/redhat-release,這種方法只適合Redhat系的Linux:
3、cat /etc/issue
經測試不適合centos7的,找到其他不適合的再補充。
附:lsb_release命令安裝
1、查找哪個源包含這個命令
yum provides */lsb_release
2、從上面的輸出可以看到redhat-lsb-core-4.1-27.el7.centos.1.x86_64這個package包含這個命令,那就安裝這個包。
[root@localhost ~]# yum install -y redhat-lsb-core-4.1-27.el7.centos.1.x86_64
3、測試: