Linux Find Out My Machine Name/Hostname

To find out the hostname of a Linux machine, you can use the “hostname” command. Here’s an example:

hostname

This will print the hostname of the machine to the terminal. If you want to see the fully qualified domain name (FQDN), you can use the “hostname -f” command:

hostname -f

This will print the hostname as well as the domain name, for example “host.example.com”.

You can also view the hostname by checking the contents of the “/etc/hostname” file. For example:

cat /etc/hostname

This will show the hostname of the machine, which is stored in this file.

Leave a Comment