HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

hostname — Show or set the system's host name. More information: <https://www.gnu.org/software/inetutils/manual

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandhostnameshowclihostsetsystem

Problem

How to use the hostname command: Show or set the system's host name. More information: <https://www.gnu.org/software/inetutils/manual/inetutils.html#hostname-invocation>.

Solution

hostname — Show or set the system's host name. More information: <https://www.gnu.org/software/inetutils/manual/inetutils.html#hostname-invocation>.

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}}

Code Snippets

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}}

Context

tldr-pages: common/hostname

Revisions (0)

No revisions yet.