How to Change Computer Name in Ubuntu

How to Change Computer Name in Ubuntu
  1. Open a terminal window.

  2. At the input prompt you will see this structure:

nicholas@computer-name:~$ _  
  1. So you have to edit the hostname file:
sudo nano /etc/hostname  
  1. When prompted, enter the administrator password and hit Enter.

  2. The hostname file will open, showing the current computer name. Replace the name with the desired new name.

  3. Hit Ctrl+X to save and exit.

  4. New name will show when you open a new terminal window.