阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

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

40次阅读
没有评论

共计 1685 个字符,预计需要花费 5 分钟才能阅读完成。

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

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

lsb_release

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

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

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 中查看版本信息命令介绍

内核版本

查看内核版本一般都使用 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

阿里云 2 核 2G 服务器 3M 带宽 61 元 1 年,有高配

腾讯云新客低至 82 元 / 年,老客户 99 元 / 年

代金券:在阿里云专用满减优惠券

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2024-07-25发表,共计1685字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中