Darui's blog

Home | About | Contacts | Archive

查看Linux系统版本的命令

查看Linux系统版本的命令

1、lsb_release -a

即可列出所有版本信息

[admin@iZqz9adg00a6qor8gjner0Z ~]$ lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	CentOS
Description:	CentOS Linux release 7.8.2003 (Core)
Release:	7.8.2003
Codename:	Core

这个命令适用于所有的Linux发行版,包括RedHat、SUSE、Debian…等发行版。

2、cat /etc/redhat-release

这种方法只适合Redhat系的Linux:

[admin@iZqz9adg00a6qor8gjner0Z ~]$ cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
Category: contos7
Tags: [ contos7  version  ]

Darui's blog | 鲁ICP备 15018213号-1 | 本站作品采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可。 | Build with Github and true minimal theme