linux查看版本信息(linux查看系统版本命令)
admin
2023-04-27 10:51:31

简介

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) andDistribution 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/aDistributor ID: ManjaroLinuxDescription: Manjaro LinuxRelease: 21.0.2Codename: 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文件。

内核版本

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

uname -aLinux 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/versionLinux version 5.11.14-1-MANJARO (builduser@LEGION) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Wed Apr 14 08:25:29 UTC 2021

以上就是爱惜日网»linux查看版本信息(linux查看系统版本命令)的相关内容了,更多精彩请关注作者:爱惜日号SEO专员

声明:本文由爱惜日网/爱惜日号作者编辑发布,更多技术关注!

相关内容

热门资讯

脚上的穴位图 脚面经络图对应的... 人体穴位作用图解大全更清晰直观的标注了各个人体穴位的作用,包括头部穴位图、胸部穴位图、背部穴位图、胳...
阿西吧是什么意思 阿西吧相当于... 即使你没有受到过任何外语培训,你也懂四国语言。汉语:你好英语:Shit韩语:阿西吧(아,씨발! )日...
demo什么意思 demo版本... 618快到了,各位的小金库大概也在准备开闸放水了吧。没有小金库的,也该向老婆撒娇卖萌服个软了,一切只...
北京的名胜古迹 北京最著名的景... 北京从元代开始,逐渐走上帝国首都的道路,先是成为大辽朝五大首都之一的南京城,随着金灭辽,金代从海陵王...