Linux Commands Reference - Complete Linux Command Guide

Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.

Share
Back to commands

hostname

Show or set system hostname

Syntax

hostname [OPTION]... [NAME]

Common Options

-aShow alias
-dShow domain name
-fShow FQDN
-iShow IP address
-IShow all IP addresses
-sShow short hostname

Common Examples

hostname

Show hostname

hostname -I

Show all IP addresses

hostname -f

Show FQDN

hostname newname

Set new hostname (temporary)

hostname -i

Show IP for hostname

Related Commands

Related Tools

More Code & Dev Tools