![屏幕快照 2019-08-19 12.52.47](https://img2018.cnblogs.com/blog/956289/202002/956289-20200226163317090-1120450824.png)
![屏幕快照 2019-08-19 12.54.19](https://img2018.cnblogs.com/blog/956289/202002/956289-20200226163317272-1516587795.png)
![屏幕快照 2019-08-19 12.55.27](https://img2018.cnblogs.com/blog/956289/202002/956289-20200226163317414-1427461171.png)
![屏幕快照 2019-08-19 12.55.56](https://img2018.cnblogs.com/blog/956289/202002/956289-20200226163317418-657537823.png)
![屏幕快照 2019-08-19 12.56.27](https://img2018.cnblogs.com/blog/956289/202002/956289-20200226163317330-1591492144.png)
![屏幕快照 2019-08-19 12.58.08](https://img2018.cnblogs.com/blog/956289/202002/956289-20200226163317348-1297657637.png)
![屏幕快照 2019-08-19 13.00.28](https://img2018.cnblogs.com/blog/956289/202002/956289-20200226163317433-674923034.png)
![屏幕快照 2019-08-19 13.00.18](https://img2018.cnblogs.com/blog/956289/202002/956289-20200226163317312-1510951006.png)
查看主机名
//查看一下当前主机名的情况,查看全部三种主机名
hostnamectl
//或者,查看全部三种主机名
hostnamectl status
//只查看静态、瞬态或灵活主机名,分别使用--static,--transient或--pretty选项
[root@xh00 ~]# hostnamectl --static
xh00
[root@xh00 ~]# hostnamectl --transient
xh01
[root@xh00 ~]# hostnamectl --pretty
//或者,查看到的是瞬态的(Tansient hostname)
hostname
//或者查看主机名配置文件,查看到的是静态的(Static hostname)
cat /etc/hostname
查看当前Linux操作系统相关信息(内核版本号、硬件架构、主机名称和操作系统类型等):
uname -a //查看到的是瞬态的(Tansient hostname)
cat /etc/redhat-release //查看操作系统环境
修改主机名
临时有效
hostname 主机名 //只能临时修改的主机名,当重启机器后,主机名称又变回来了。
hostname hx01
永久生效
hostnamectl set-hostname hx01
还有一个办法编辑 /etc/hostname 文件
vim /etc/hostname
重启命令
reboot init 6 shutdown -r now
关机
poweroff init 0 shoutdown -h now
安装图形
yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
init 5