200728-Centos hostname修改

centos 6 修改方式

1
2
3
4
# 修改hostname,立即生效
hostname new-hostname
# 查看hostanme
hostname

centos 7 修改方式

1
2
3
4
# 修改hostname,立即生效
hostnamectl set-hostname new-hostname
# 查看hostname
hostname
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×