how to change your hostname in linux code example
Example 1: how to get hostname on linux
$ hostnamectl
Example 2: centos change hostname
# hostnamectl set-hostname your-new-hostname
Example 3: linux change hostname
sudo nano /etc/hostname
sudo nano /etc/hosts
sudo reboot