Ubuntu
系统信息多,可以采用不同的命令
一、
sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic
二、
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"
三、
cat /etc/issue
Ubuntu 18.04.5 LTS \n \l
四、
cat /proc/version
Linux version 4.15.0-29-generic (buildd@lgw01-amd64-057) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018
五、
uname -a
Linux VM-39-236-ubuntu 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
CentOS
一、
/etc/centos-release 文件
[root@ecs-209716 ~]# cat /etc/centos-release
CentOS Linux release 8.5.2111
[root@ecs-209716 ~]# cat /etc/redhat-release
CentOS Linux release 8.5.2111
[root@ecs-209716 ~]# cat /proc/version
Linux version 4.18.0-348.7.1.el8_5.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-4) (GCC)) #1 SMP Wed Dec 22 13:25:12 UTC 2021
二、
hostnamectl 命令
[root@ecs-209716 ~]# hostnamectl
Static hostname: ecs-209716
Icon name: computer-vm
Chassis: vm
Machine ID: cb920901aa34498786281c336dcbf921
Boot ID: 70826aec60664b8e9cf822c691306fa3
Virtualization: kvm
Operating System: CentOS Linux 8 (Core)
CPE OS Name: cpe:/o:centos:centos:8
Kernel: Linux 4.18.0-348.7.1.el8_5.x86_64
Architecture: x86-64
三、
[root@ecs-209716 ~]# rpm -q centos-release
centos-release-8.2-2.2004.0.1.el8.x86_64