Forrest logo
back to the nmcli tool

nmcli-general:tldr:40d1f

nmcli-general: Show the hostname of the current device.
$ nmcli general hostname
try on your machine

The command "nmcli general hostname" is used to view or modify the hostname of the system using the NetworkManager command-line interface (nmcli). When used without any additional arguments, "nmcli general hostname" displays the current hostname of the system. If you want to modify the hostname, you can use the following syntax: nmcli general hostname [hostname] Replace [hostname] with the desired hostname you want to set. After executing this command, the hostname of the system will be updated accordingly. It's important to note that changing the hostname may require administrative privileges.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the nmcli tool