Reference: ubuntu-change-hostname-command
-
modify the /etc/hostname file and change the hostname to as per your choice.
sudo vim /etc/hostname
-
modify /etc/hosts file and change the hostname to as per your choice.
sudo vim /etc/hosts
-
using hostnamectl command again change the hostname
sudo hostnamectl set-hostname nitin-pc01