hostname
SystemBeginner In simulator In real LinuxShow or set the host name
Name: hostname: host name
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
hostname shows or temporarily sets the system's host name, the machine's name on the network. A name set this way is lost on reboot; use hostnamectl set-hostname to change it permanently.
Syntax
hostname [NAME]Common options
| -I | Show all IP addresses of the host |
| -i | Show the addresses the host name resolves to |
| -s | Show the short name (up to the first dot) |
| -f | Show the fully qualified domain name |
Examples
$ hostname
Show the host name
Explain