Problem Statement
Which command displays or sets the system hostname?
Explanation
hostnamectl is used to view and change the system hostname.
It’s part of systemd and also shows OS information and kernel details.
Code Solution
SolutionRead Only
sudo hostnamectl set-hostname dev-server
Practice Sets
This question appears in the following practice sets: