Show or set the hostname
medium risk
Without arguments prints the hostname; with an argument sets it until reboot.
| Flag | Meaning |
|---|---|
-f | FQDN |
-I | All IP addresses |
hostname -fFully-qualified name · explain & risk-check →hostname -IIP addresses · explain & risk-check →Reference text is hand-written and may be incomplete — check man hostname for your version. Test destructive commands on a non-production system first.