查看Linux OS内核与版本的几种命令:
方法一:
[root@localhost ~]# cat /etc/os-release
NAME="openEuler"
VERSION="23.03"
ID="openEuler"
VERSION_ID="23.03"
PRETTY_NAME="openEuler 23.03"
ANSI_COLOR="0;31"
方法二:
[root@localhost ~]# cat /proc/version
Linux version 6.1.19-7.0.0.17.oe2303.x86_64 (root@-ci) (gcc_old (GCC) 10.3.1, GNU ld (GNU Binutils) 2.37) #1 SMP PREEMPT_DYNAMIC Tue Mar 28 00:01:02 CST 2023
方法三:
[root@localhost ~]# uname -a
Linux 6.1.19-7.0.0.17.oe2303.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 28 00:01:02 CST 2023 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]#
方法四:
#需要系统有包支持,没有的话需要联网安装,如下所示
[root@ss /]# lsb_release -a
bash: lsb_release: command not found...
Install package 'redhat-lsb-core' to provide command 'lsb_release'? [N/y] y
* Waiting in queue...
* Loading list of packages....
The following packages have to be installed:
esmtp-1.2-15.el8.x86_64 User configurable send-only Mail Transfer Agent
libesmtp-1.0.6-18.el8.x86_64 SMTP client library
liblockfile-1.14-1.el8.x86_64 This implements a number of functions found in -lmail on SysV systems
m4-1.4.18-7.el8.x86_64 The GNU macro processor
mailx-12.5-29.el8.x86_64 Enhanced implementation of the mailx command
ncurses-compat-libs-6.1-9.20180224.el8.x86_64 Ncurses compatibility libraries
patch-2.7.6-11.el8.x86_64 Utility for modifying/upgrading files
redhat-lsb-core-4.1-47.el8.x86_64 LSB Core module support
redhat-lsb-submod-security-4.1-47.el8.x86_64 LSB Security submodule support
spax-1.5.3-13.el8.x86_64 Portable archive exchange
Proceed with changes? [N/y] y
* Waiting in queue...
* Waiting for authentication...
* Waiting in queue...
* Downloading packages...
* Requesting data...
* Testing changes...
* Installing packages...
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 8.4.2105
Release: 8.4.2105
Codename: n/a
[root@ss /]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 8.4.2105
Release: 8.4.2105
Codename: n/a