hostname - Display the name of the current host system

Synopsis

hostname [-is]

Description

The hostname utility writes the name of the current host system to standard output.

Options

-i
Also display the IP address of the host system.
-s
Display the short name of the host system without the domain information.

Exit status

  • 0 when successful
  • >0 when an error occurs