网站首页 > 基础教程 正文
简介
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文件。
内核版本
查看内核版本一般都使用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.36.1) #1 SMP PREEMPT Wed Apr 14 08:25:29 UTC 2021
- 上一篇: 大企业才用的分布式唯一Id,它比GUID好
- 下一篇: Linux面试题分享-用户管理有哪些知识点?
猜你喜欢
- 2024-11-13 SPI_FLASH编程_读ID spi flash 编程器
- 2024-11-13 Linux系统下配置VLAN 如何配置linux网络设置
- 2024-11-13 如何在 Linux 中查找父进程 PPID linux查找进程名称
- 2024-11-13 Linux面试题分享-用户管理有哪些知识点?
- 2024-11-13 大企业才用的分布式唯一Id,它比GUID好
- 2024-11-13 Linux系统移植篇2:STM32MP1微处理器之系统镜像烧写
- 2024-11-13 2. Zookeeper ACL 组成 zookeeper consul
- 2024-11-13 详细指南:如何在Linux中查看系统版本信息
- 2024-11-13 iPhone X 绕过 Apple ID 锁,直接激活使用
- 2024-11-13 英特尔 14 代酷睿敲定,Linux 5.20 已初步支持 Meteor Lake 集显
- 06-18单例模式谁都会,破坏单例模式听说过吗?
- 06-18Objective-c单例模式的正确写法「藏」
- 06-18单例模式介绍(单例模式都有哪些)
- 06-18前端设计-单例模式在实战中的应用技巧
- 06-18PHP之单例模式(php单例模式连接数据库)
- 06-18设计模式:单例模式及C及C++实现示例
- 06-18python的单例模式(单例 python)
- 06-18你认为最简单的单例模式,东西还挺多
- 最近发表
- 标签列表
-
- jsp (69)
- gitpush (78)
- gitreset (66)
- python字典 (67)
- dockercp (63)
- gitclone命令 (63)
- dockersave (62)
- linux命令大全 (65)
- pythonif (86)
- location.href (69)
- dockerexec (65)
- tail-f (79)
- queryselectorall (63)
- location.search (79)
- bootstrap教程 (74)
- 单例 (62)
- linuxgzip (68)
- 字符串连接 (73)
- html标签 (69)
- c++初始化列表 (64)
- mysqlinnodbmyisam区别 (63)
- arraylistadd (66)
- mysqldatesub函数 (63)
- window10java环境变量设置 (66)
- c++虚函数和纯虚函数的区别 (66)