大家好,又见面了,我是你们的朋友全栈君。
1.查看内核版本
$ uname -sr
Linux 4.15.11-1.el7.elrepo.x86_64
$ uname -a
Linux localhost.localdomain 4.15.11-1.el7.elrepo.x86_64 #1 SMP Mon Mar 19 11:46:06 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux
$ cat /proc/version
Linux version 4.15.11-1.el7.elrepo.x86_64 (mockbuild@Build64R7) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)) #1 SMP Mon Mar 19 11:46:06 EDT 2018
2.查看发行版本
适用于所有linux发行版本
# cat /etc/os-release
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"
适用于redhat发行版本
$ yum install -y redhat-lsb-core
$ 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.4.1708 (Core)
Release: 7.4.1708
Codename: Core
$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
$ cat /etc/centos-release
CentOS Linux release 8.2.2004 (Core)
$ cat /etc/system-release
Fedora release 27 (Twenty Seven)
适用于ubuntu发行版本
$ apt-get install lsb-core
$ lsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
适用于所有linux发行版本
$ cat /etc/issue
Debian GNU/Linux 10 \n \l
$ cat /etc/issue.net
Debian GNU/Linux 10
适用于debain发行版本
$ cat /etc/debian_version
10.8
访问wiki查看发行版本与内核版本对应关系:https://en.wikipedia.org/wiki/CentOS
访问Red Hat官方链接:https://access.redhat.com/articles/3078
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/182513.html原文链接:https://javaforall.cn