查看Linux OS内核与版本的几种命令

文章介绍了在Linux系统中检查内核与版本的四种方法:通过查看/etc/os-release文件,阅读/proc/version文件,使用uname-a命令,以及安装和使用lsb_release命令。这些命令帮助用户获取系统详细信息,如发行版名称、版本号和内核版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

查看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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值