Linux中查看版本信息具体方法

Linux有很多发行版本,一般通过内核就可以判断大致的发行版本。但是如果需要详细的发行版本信息,就可以借助命令进行查看。

lsb_release

显示LSB(Linux Standard Base)兼容的发行版本信息。如果是LSB兼容的发行版本,在/etc/lsb-release就可以查看到具体的版本信息。

lsb_release可以快速过滤这些信息找到自己需要的字段,这个命令有可能没有自带,可以自行安装lsb-release包就可以有了。

lsb_release -h
FSG lsb_release v1.4 prints certain LSB (Linux Standard Base) and
Distribution information.

Usage: lsb_release [OPTION]...
With no OPTION specified it is the same as -v.

Options:
 -v, --version
   Display the version of the LSB specification against which the distribution is compliant.
 -i, --id
   Display the string id of the distributor.
 -d, --description
   Display the single line text description of the distribution.
 -r, --release
   Display the release number of the distribution.
 -c, --codename
   Display the codename according to the distribution release.
 -a, --all
   Display all of the above information.
 -s, --short
   Display all of the above information in short output format.
 -h, --help
   Display this message.
lsb_release -a
LSB Version:    n/a
Distributor ID: ManjaroLinux
Description:    Manjaro Linux
Release:    21.0.2
Codename:   Ornara

Version文件

lsb_release这个命令需要有另外安装,如果没有安装也可以通过其他的版本信息文件找到版本的信息。

RHEL系列:/etc/redhat-release、/etc/os-release、/etc/system-release 等,这些文件一般都是指向同一个文件,如果是重新发行的版本,例如centos,还会有/etc/centos-release

Debian系列:/etc/debian-version、/etc/issue等,同样重新发行的版本也会有对应的version文件。

Linux中查看版本信息命令介绍Linux中查看版本信息命令介绍

内核版本

查看内核版本一般都使用uname这个命令。

uname -a
Linux manjaro 5.11.14-1-MANJARO #1 SMP PREEMPT Wed Apr 14 08:25:29 UTC 2021 x86_64 GNU/Linux

用这个命令也可以快速过滤到自己需要的字段。

也可以直接查看/proc/version来查看当前云中的内核版本

cat /proc/version
Linux version 5.11.14-1-MANJARO (builduser@LEGION) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils

原创文章,作者:晴川运维,如若转载,请注明出处:https://baike.qcidc.com/6550.html

(0)
晴川运维晴川运维
上一篇 2025年6月8日
下一篇 2025年6月8日

相关推荐

  • 安装完Debian 10 之后需要做的10件事情

    Debian 10 Buster 是 Debian 社区于 2019-07-06 推出的继 Debian 9 之后的下一代 Debian 系统。Buster 是 Debian 10…

    Debian 2025年6月8日
  • 通过LVS + Keepalived 部署MySQL高可用

    LVS是Linux Virtual Server的简称,也就是Linux虚拟服务器, 是一个由章文嵩博士发起的自由软件项目,它的官方站点是www.linuxvirtualserve…

    Debian 6天前
  • 如何在 Debian Linux 上设置和配置网桥

    Q:我是一个新 Debian linux 用户,我想为 Debian Linux 上运行的虚拟化环境(KVM)设置网桥。那么我该如何在 Debian Linux 9.x 服务器上的…

    Debian 2025年6月8日
  • 【Debian GNU/Linux 安装手册】1.8. 关于版权与软件协议

    1.8. 关于版权与软件协议 我们相信您曾经阅读过许多商业软件的许可证 — 它们通常要求您只能在一台计算机上使用一份软件拷贝。本系统与它们完全不同。我们鼓励您将 Debi…

    Debian 2025年6月8日
  • 讲解一下screen命令使用方法

    Screen是一款由GNU计划开发的用于命令行终端切换的自由软件。用户可以通过该软件同时连接多个本地或远程的命令行会话,并在其间自由切换。GNU Screen可以看作是窗口管理器的…

    Debian 3天前
  • Linux查看内存版本具体方法

    Linux内核版本命名在不同时期有着不同的规范,在涉及到Linux版本问题时经常容易混淆,主线版本/稳定版/长期支持版本经常搞不清楚,下面大家详细讲解一下查看Linux内核版本具体…

    Debian 2025年6月8日
  • Linux 的vi和vim 有什么不同?

    Linux 的vi和vim 有什么不同? Vi 和 Vim 都是 Linux 中常用的文本编辑器,它们的主要区别在于以下几点: 1. 命令模式的默认设置不同:Vi 在启动时默认进入…

    Debian 1天前
  • 【Debian GNU/Linux 安装手册】1.4. 什么是 Debian 安装程序?

    1.4. 什么是 Debian 安装程序? Debian 安装程序,也被称为 “d-i” ,是安装 Debian 系统进行基本工作的软件系统。嵌入式设备、笔记本计算机、台…

    Debian 2025年6月8日
  • 【Debian GNU/Linux 安装手册】3.1. 安装概述

    3.1. 安装概述 先说一下有关重新安装的事情。使用 Debian 时,极少出现必须进行完全重新安装的情况,导致这种情况的可能大多是硬盘的物理故障。 许多常见的操作系统在…

    Debian 2025年6月8日
  • Linux中常用的扫描工具

    针对Linux服务器的攻击和端口扫描从未停过;虽然正确配置的防火墙和安全系统定期更新增添了额外的一层防线以确保系统安全,但是还应该经常观察是否有人潜入。这还有助于确保服务器远离任何…

    Debian 2025年6月11日

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注