gpt4 book ai didi

一篇带给你Linux 查看版本信息

转载 作者:qq735679552 更新时间:2022-09-28 22:32:09 26 4
gpt4 key购买 nike

CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.

这篇CFSDN的博客文章一篇带给你Linux 查看版本信息由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.

 简介 。

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

一篇带给你Linux 查看版本信息

lsb_release 。

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

一篇带给你Linux 查看版本信息

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

  1. lsb_release -h 

  1. FSG lsb_release v1.4 prints certain LSB (Linux Standard Base) and 
  2. Distribution information. 
  3.  
  4. Usage: lsb_release [OPTION]... 
  5. With no OPTION specified it is the same as -v. 
  6.  
  7. Options: 
  8.   -v, --version 
  9.     Display the version of the LSB specification against which the distribution is compliant. 
  10.   -i, --id 
  11.     Display the string id of the distributor. 
  12.   -d, --description 
  13.     Display the single line text description of the distribution. 
  14.   -r, --release 
  15.     Display the release number of the distribution. 
  16.   -c, --codename 
  17.     Display the codename according to the distribution release. 
  18.   -a, --all 
  19.     Display all of the above information. 
  20.   -s, --short 
  21.     Display all of the above information in short output format. 
  22.   -h, --help 
  23.     Display this message. 

  1. lsb_release -a 

  1. LSB Version:    n/a 
  2. Distributor ID: ManjaroLinux 
  3. Description:    Manjaro Linux 
  4. Release:    21.0.2 
  5. 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这个命令.

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

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

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

  1. cat /proc/version 
  2. Linux 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 

原文地址:https://www.toutiao.com/i6956354337128006158/ 。

最后此篇关于一篇带给你Linux 查看版本信息的文章就讲到这里了,如果你想了解更多关于一篇带给你Linux 查看版本信息的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com