• linux命令-修改主机名hostnamectl


    修改主机名命令hostnamectl set-hostname <新名称>

    命令帮助如下:

    [root@localhost ~]# hostnamectl --help
    hostnamectl [OPTIONS...] COMMAND ...
    
    Query or change system hostname.
    
      -h --help              Show this help
         --version           Show package version
         --no-ask-password   Do not prompt for password
      -H --host=[USER@]HOST  Operate on remote host
      -M --machine=CONTAINER Operate on local container
         --transient         Only set transient hostname
         --static            Only set static hostname
         --pretty            Only set pretty hostname
    
    Commands:
      status                 Show current hostname settings
      set-hostname NAME      Set system hostname
      set-icon-name NAME     Set icon name for host
      set-chassis NAME       Set chassis type for host
      set-deployment NAME    Set deployment environment for host
      set-location NAME      Set location for host

    命令查询和修改

    [root@localhost ~]# hostnamectl 
       Static hostname: localhost.localdomain
             Icon name: computer-vm
               Chassis: vm
            Machine ID: 867aaa1c353c4aad8510c0ee973bc083
               Boot ID: 6f9f8d5dd4f7426daff92ee2e0b736cf
        Virtualization: kvm
      Operating System: CentOS Linux 7 (Core)
           CPE OS Name: cpe:/o:centos:centos:7
                Kernel: Linux 3.10.0-693.11.1.el7.x86_64
          Architecture: x86-64
    [root@localhost ~]# hostnamectl set-hostname openstack
    [root@localhost ~]# hostnamectl 
       Static hostname: openstack
             Icon name: computer-vm
               Chassis: vm
            Machine ID: 867aaa1c353c4aad8510c0ee973bc083
               Boot ID: 6f9f8d5dd4f7426daff92ee2e0b736cf
        Virtualization: kvm
      Operating System: CentOS Linux 7 (Core)
           CPE OS Name: cpe:/o:centos:centos:7
                Kernel: Linux 3.10.0-693.11.1.el7.x86_64
          Architecture: x86-64
     
    shanzhiyou
  • 相关阅读:
    维护gcd的线段树 补发一波。。。
    BZOJ 4720: [Noip2016]换教室
    P2184 贪婪大陆 树状数组
    BZOJ 1047: [HAOI2007]理想的正方形 单调队列瞎搞
    POJ3280 Cheapest Palindrome 区间DP
    BZOJ 2288: 【POJ Challenge】生日礼物 堆&&链表
    BZOJ 4236: JOIOJI map瞎搞
    浅谈最近公共祖先(LCA)
    题解 BZOJ 1912 && luogu P3629 [APIO2010]巡逻 (树的直径)
    [笔记] 求树的直径
  • 原文地址:https://www.cnblogs.com/shanzhiyou/p/8134195.html
Copyright © 2020-2023  润新知