Mac terminal shows wrong host name

Problem

Mac terminal shows the wrong hostname on prompt.

Solution

Find out if a hostname is already specified.

$ sudo scutil --get HostName
HostName: not set

To set your Hostname

$ sudo scutil --set HostName 'myname'

Exit out of your terminal and start a new terminal. You should see your chosen hostname.

Technologies: 
Actions: