Tuesday, February 11, 2014

Change Ubuntu Devicename (Hostname)

Change the “device name” in the details window of System settings

$ sudo sed -i 's/present-host-name/new-host-name/' /etc/hosts
$ sudo sed -i 's/present-host-name/new-host-name/' /etc/hostname
$ reboot

Hmmm. attempt on the 2nd sed command failed and the /etc/hostname file was already correct. Perhaps it was changed automatically in response to the first sed.

You can check your present-host-name by
$ cat /etc/hostname
or
$ hostname


No comments:

Post a Comment