Display the host name portion of the full computer name of the computer.
Syntax HOSTNAME Options /? Display Help
The hostname command is only available if the Internet Protocol (TCP/IP) is installed as a network component.
The computer hostname is usually (but not always) the same as the %COMPUTERNAME% variable.
When called with any argument other than /? hostname sets errorlevel to 1 and prints an error message.
Display the system hostname:
“There's a little bit of magic in everything, and some loss to even things out” ~ Lou Reed
Equivalent PowerShell command: $env:COMPUTERNAME
Equivalent bash command: hostname