What is the command to change hostname in Linux?

What is the command to change hostname in Linux?
Answer
To change the hostname invoke the hostnamectl command with the set-hostname argument followed by the new hostname. Only the root or a user with sudo privileges can change the system hostname.
 

Tìm kiếm

Back
Top