System and processes

The hostnamectl command

Shows and changes the machine name and machine data (operating system, kernel, architecture).

Syntax

hostnamectl [set-hostname NOMBRE]

Most useful options

statusCurrent machine status
set-hostnameChanges the machine name

Copy-ready examples

$ hostnamectlMachine data

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • Changing the hostname requires administrator rights.

Related commands

FAQ

Does the name reset on shutdown?

No: hostnamectl makes it permanent, unlike hostname.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course