centos7 上在主机名变更新增了一个hostnamectl 指令 ,该指令的无论在输出和更改上都较之前更加的便利。先看下hostname的help帮助信息: 1[root@361way ~]# hostnamectl --help 2hostnamectl [OPTIONS...] COMMAND ... 3Query or change system hostname. 4 -h --help Show this help 5 --version Show package version 6 --transient Only set transient hostname 7 --static Only set static hostname 8 --pretty Only set pretty hostname 9 -P --privileged Acquire privileges before execution 10 --no-ask-password Do not prompt for password 11 -H --host=[USER@]HOST Operate on remote host 12Commands: 13 status Show current hostname……
Continue reading