Host Name in Shell

Level 18 keystrokes

hostname displays the system's network hostname.

Shell code

# Prints the network name of this machine (here: webserver-01)
# Handy in scripts and prompts to tell which server you are on
1hostname

Output

webserver-01
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

More Shell examples at level 1

← Shell typing practice