Networking

hostname

Shows or sets the system hostname.

hostname prints the current host name and can temporarily set it on some systems.

Syntax
hostname [name]

Arguments explained

  • Options adjust output or behavior.
  • Arguments name the files, services, hosts, or values the command should work with.

Common examples

Show hostname
hostname

Prints the current hostname.

Show IP addresses
hostname -I

Prints IP addresses assigned to the host on many systems.

hostname Command
FieldDetails
Commandhostname
CategoryNetworking
Primary useShows or sets the system hostname.
Syntaxhostname [name]