Morning, lets look how to change hostname of your Ubuntu machine. Just change the newhostname variable to your new machine name and tadah
newhostname="pi-enviro"
echo "$newhostname" | sudo tee /etc/hostname
# add hostname to /etc/hosts
echo "127.0.1.1 $newhostname" | sudo tee -a /etc/hosts
That's all and funky time