hostnamectl
CautionShow/set hostname
hostnamectl
Shows hostname plus OS/kernel info. set-hostname changes it persistently on systemd systems.
Examples
hostnamectl set-hostname web01Set the hostname
Syntax
hostnamectl [set-hostname NAME]
Before you run it
Renaming can affect certs/cluster configs.
The same reference, with no signal at all
Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).
Get it free on the App Store