How to Change MacOS hostname using the Terminal

Hola! the other day I had a need to change a MacOS hostname using the Terminal. I did not have access to a GUI and had to do this remotely. Chagning the hostname using MacOS Terminal is quite simple and is my favorite method. This is why I decided to document this little how to. …