时间:2020-06-01来源:www.pcxitongcheng.com作者:电脑系统城
[root@localhost ~]# hostname
localhost.localdomain
[root@localhost ~]# hostnamectl
Static hostname: localhost.localdomain
Icon name: computer-vm
Chassis: vm
Machine ID: 90300023da1f4b85b4c7cd89dbb4f1cc
Boot ID: c054f20e33d74e1a8ec29557885c75c6
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-957.el7.x86_64
Architecture: x86-64
[root@localhost ~]# hostnamectl set-hostname study
127.0.0.1 study.linux.com study
::1 study.linux.com study
重新启动服务器,使用hostname命令和hostnamectl命令查看主机名
[root@study ~]# hostname
study
[root@study ~]# hostname -a
study.linux.com study.linux.com
[root@study ~]# hostnamectl
Static hostname: study
Icon name: computer-vm
Chassis: vm
Machine ID: 90300023da1f4b85b4c7cd89dbb4f1cc
Boot ID: c054f20e33d74e1a8ec29557885c75c6
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-957.el7.x86_64
Architecture: x86-64
2023-02-28
解决linux不识别nfst格式u盘问题技巧 linux无法识别ntfs格式U盘怎么办?2023-02-28
linux扩容swap分区的技巧 linux怎么调整swap大小?2023-02-26
微软Linux资源库首次加入Edge浏览器稳定版当linux在运作时不能直接关闭电源容易将档案系统损毁,因此需要用shutdown以安全的方式关闭,那么这个操作该怎么实现呢?下面就为大家带来了详细教程。...
2022-11-07
由于linux系统和我们常用的windows系统是不一样的,所以如果是初学者,可能会不知道linux怎么强制删除文件,其实我们只要打开终端,使用命令就可以删除了。...
2022-11-03