I use terminal quite often, for some reason all of a sudden Terminal is showing a strange android-1e1c8882e08308f9
hostname (see image) in the prompt.
I've checked my MacBook's hostname in Sharing Preferences and this is correct, but Terminal is still showing the android hostname.
Can anyone advise?
Thanks
By default, the host name of your computer is not set. The Sharing panel lets you set the computer name, which is a Mac OS X-specific attribute. My theory is that if the host name is not set, hostname
(and your shell prompt) will use this value instead. The following is the output of scutil
and hostname
on my laptop.
patikoija ~ % scutil --get ComputerName
patikoija
patikoija ~ % scutil --get LocalHostName
patikoija
patikoija ~ % scutil --get HostName
HostName: not set
patikoija ~ % hostname
patikoija.local
When I visit my company's office, my host name is similarly set to something that begins with 'dhcp-'. I suppose that the DHCP server sets the actual host name, and running scutil
there would show that name. You can try using scutil
to set the true host name of your computer, and see if that "resists" efforts by the DHCP server to override it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With