hostnamectl
Get or set the hostname of the computer. tldr-pages
On Linux
Linux
Get the hostname of the computer
hostnamectlIdentifySet the hostname of the computer
sudo hostnamectl set-hostname "hostname"IdentifySet a pretty hostname for the computer
sudo hostnamectl set-hostname --static "hostname.example.com" && sudo hostnamectl set-hostname --pretty "hostname"IdentifyReset hostname to its default value
sudo hostnamectl set-hostname --pretty ""Identify