Display Computer Name
The hostname command displays your computer's name on the network. This is the friendly name that identifies your machine to other devices and appears in network lists.
Your hostname is how your computer is known on the network - like a name tag for your machine. It's used by network administrators, file sharing, and various network services to identify your computer.
Advertisement
[ Insert Google AdSense Banner Code Here ]
Quickly see what your computer is called on the network.
Identify which computer you're connected to when managing multiple machines.
Use in scripts to identify which machine is running the script.
Verify your computer's network identity when diagnosing connection issues.
hostname Display your computer's network name.
hostname -s Display short hostname (Linux/Mac - without domain).
hostname -f Display fully qualified domain name (Linux/Mac).
hostname -i Display IP address associated with hostname (Linux).
Practice using the hostname command in the terminal below: