Ad space (banner)
🖥️Linux Lessons
Lesson 43 / 61

Checking Your Computer's Name with hostname

hostname is for when "I want to check this server's name (hostname)." hostname displays the name configured on the computer you're currently using.

It's a simple command that needs no arguments — just type hostname alone.

Running hostname prints one line — the hostname configured on that machine, something like web-server-01.

A common early mistake is losing track of which server you're on while working across several SSH connections. Building the habit of checking with hostname prevents accidents.

In real work, this is used a lot in operations dealing with multiple servers, specifically to confirm "which server am I working on right now."

Linux
Try it (type this into the pseudo terminal)
hostname

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)