Displaying and modifying the hostname

The hostname command is used to view the hostname or to temporarily modify the hostname at runtime. And the hostnamectl command is used to permanently modify the hostname from command line.

Following are the examples to illustrate the usage of hostname command:

  • View the fully qualified host name of CentOS 7 using the hostname command as shown here:

  • Modify the fully qualified hostname temporarily at runtime, using the hostname command as shown here:

Following are the examples to illustrate the usage of hostnamectl command:

  • View the hostname changes made using the hostnamectl command as shown in the following screenshot:

  • Use the hostnamectl command to make permanent changes to the hostname as shown in following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.236.62