Linux:查看系统版本号

本文介绍了五种在Linux系统中检查系统版本的方法:通过cat/proc/version、uname-a、cat/etc/os-release、cat/etc/redhat-release及使用hostnamectl命令。这些方法能够帮助用户快速准确地获取当前Linux系统的版本信息。

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

方式一:cat /proc/version

$ cat /proc/version
Linux version 4.19.76-linuxkit (root@4abe09437d05) (gcc version 8.3.0 (Alpine 8.3.0)) 
#1 SMP Tue May 26 11:42:35 UTC 2020

方式二:uname -a

$ uname -a
Linux 619fe68308c7 4.19.76-linuxkit #1 SMP Tue May 26 11:42:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

方式三:cat /etc/os-release

$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"

方式四:cat /etc/redhat-release

$ cat /etc/redhat-release
CentOS Linux release 8.5.2111

方式五:hostnamectl

$ hostnamectl
   Static hostname: 619fe68308c7
         Icon name: computer-vm
           Chassis: vm
        Machine ID: ce70cdd97ef44e4581868b3fa70bb8f9
           Boot ID: c44736cb290f47db9d27a2ae890e42ed
    Virtualization: bhyve
  Operating System: CentOS Linux 8
       CPE OS Name: cpe:/o:centos:centos:8
            Kernel: Linux 4.19.76-linuxkit
      Architecture: x86-64

参考
四种Linux系统版本号的查看方式
如何查看Linux系统版本?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值