查看主机名使用hostname或者hostnamectl命令
[root@sre01 ~]# hostname
sre01
[root@sre01 ~]# hostnamectl
Static hostname: sre01
Icon name: computer-vm
Chassis: vm
Machine ID: 75e915fb06a74c648bb373f7e884d48e
Boot ID: 618ec6663e934124a68396b66579ea6a
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1062.el7.x86_64
Architecture: x86-64
修改主机名使用hostnamectl命令永久生效
[root@sre01 ~]# hostnamectl set-hostname sre02
标签:sre01,Centos,hostname,主机名,Linux,hostnamectl,root
From: https://blog.51cto.com/zywqs/12127279