hostname

Show or set the hostname

medium risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
What it does

Without arguments prints the hostname; with an argument sets it until reboot.

Common flags
FlagMeaning
-fFQDN
-IAll IP addresses
Examples
hostname -fFully-qualified name · explain & risk-check →
hostname -IIP addresses · explain & risk-check →
Related
hostnamectl uname
Open the full explainer →More in System & Processes

Reference text is hand-written and may be incomplete — check man hostname for your version. Test destructive commands on a non-production system first.