How To Change Hostname On OpenSUSE And Apply The Changes Without Restarting The System

Hello Linux Geeksters. In this quick guide I will show you how to easily change the hostname on OpenSUSE, and apply the changes without restarting the system.

First, we have to temporary change of hostname:

$ sudo hostname NewHostname

To apply the changes, we reload the shell (if you are using a different shell, type its name in the terminal):

$ bash

$ sudo sed -i 's/OldHostname/NewHostname/g' /etc/HOSTNAME

In the below screenshot, I have replaced the hostname linux-kb3c with the hostname linuxg (the grep commands in the screenshot are just to display the changes, before and after the sed one-liners)

How To Change Hostname On OpenSUSE And Apply The Changes Without Restarting The System

Tagged with: , , ,
Posted in The Linux and Unix Articles!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!