1获取内核版本号(2个办法)
1、cat /proc/version
2、uname -a
[samba@centos share]$ uname -a
Linux centos 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[samba@centos share]$ cat /proc/version
Linux version 3.10.0-957.5.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Fri Feb 1 14:54:57 UTC 2019
2查看Linux系统版本的命令
1、cat /etc/issue (不知道咋回事,不好使)
[samba@centos share]$ cat /etc/issue
\S
Kernel \r on an \m
2、lsb_release -a (有时候没有这个命令,出现“-bash: lsb_release: command not found”)
[samba@centos cpp]$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.6.1810 (Core)
Release: 7.6.1810
Codename: Core
3、解决找不到lsb_release的办法:
解决方法:yum install redhat-lsb -y