一篇带给你Linux 查看版本信息
2023-04-18 14:41:00 时间
简介
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
【编辑推荐】
相关文章
- 【技术种草】cdn+轻量服务器+hugo=让博客“云原生”一下
- CLB运维&运营最佳实践 ---访问日志大洞察
- vnc方式登陆服务器
- 轻松学排序算法:眼睛直观感受几种常用排序算法
- 十二个经典的大数据项目
- 为什么使用 CDN 内容分发网络?
- 大数据——大数据默认端口号列表
- Weld 1.1.5.Final,JSR-299 的框架
- JavaFX 2012:彻底开源
- 提升as3程序性能的十大要点
- 通过凸面几何学进行独立于边际的在线多类学习
- 利用行动影响的规律性和部分已知的模型进行离线强化学习
- ModelLight:基于模型的交通信号控制的元强化学习
- 浅谈Visual Source Safe项目分支
- 基于先验知识的递归卡尔曼滤波的代理人联合状态和输入估计
- 结合网络结构和非线性恢复来提高声誉评估的性能
- 最佳实践丨云开发CloudBase多环境管理实践
- TimeVAE:用于生成多变量时间序列的变异自动编码器
- 具有线性阈值激活的神经网络:结构和算法
- 内网渗透之横向移动 -- 从域外向域内进行密码喷洒攻击