commands.sh
⌘K

hostname

all

Show or set the system's host name.

More info →

Options (2)

-i, --ip-addressboolean

Show the network address of the host name

Example: hostname {{[-i|--ip-address]}}
-f, --fqdnboolean

Show the FQDN (Fully Qualified Domain Name)

Example: hostname {{[-f|--fqdn]}}

Examples (4)

Show current host name

hostname

Show the network address of the host name

hostname [-i|--ip-address]

Show the FQDN (Fully Qualified Domain Name)

hostname [-f|--fqdn]

Set current host name

hostname new_hostname
made by @shridhargupta | data from tldr-pages