Linux and Unix hostname command

Quick links

About hostname
Syntax
Examples
Related commands
Unix main page

About hostname

Set or print name of current host system. Additional information about the term hostname can be found on our hostname definition.

Syntax

hostname [ name-of-host ]

name-of-hostIf proper privilege specifies the name of the host.

Examples

hostname

Would display the name of the hostname for example: computerhope.

Related commands

hostid
uname