目录
hostnamectl
Hostnamectl可用于查询和更改系统主机名及相关设置。
[waterruby@192 init.d]$ hostnamectl -h
hostnamectl [OPTIONS...] COMMAND ...
Query or change system hostname.
Commands:
status Show current hostname settings
hostname [NAME] Get/set system hostname
icon-name [NAME] Get/set icon name for host
chassis [NAME] Get/set chassis type for host
deployment [NAME] Get/set deployment environment for host
location [NAME] Get/set location for host
Options:
-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
--json=pretty|short|off
Generate JSON output
- status
See the hostnamectl(1) man page for details.
[waterruby@192 init.d]$ hostnamectl status
Static hostname: (unset)
Transient hostname: 192.168.0.110
Icon name: computer-vm
Chassis: vm
标签:实战,系统管理,Get,--,hostname,host,set,LINUX,hostnamectl
From: https://www.cnblogs.com/waterruby/p/17788345.html