查看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@dc-64g.compass-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 localhost.localdomain 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
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
发表评论