What is this called on macOS?

Given the following terminal on macOS:

https://cdn2.macworld.co.uk/cmsdata/features/3608274/Screen_Shot_2015-04-13_at_11.48.16_thumb.png

What is “Kennys-MacBook-Pro”? Is it the host name?

And how do I change it?

System Preferences → Sharing, change the Computer name.

From the terminal line:
sudo scutil --set HostName ImANewHostname

4 Likes

I’d always thought it was the name of whoever was logged in, but I’m not in front of my mac to be able to check at the moment.

1 Like

Computer name or host name?

Yes.

Changing the computer name didn’t alter what was displayed in the terminal. I’ll try changing the host name on Monday (it’s a work machine).

Well if you’ve got access to a terminal window, put the commandline one in.

Also you do need to restart the terminal window to see any changes.

Ok, ta. I’ll give it a go on Monday.

1 Like

It’s the host name. I always change it because it always exposes my real name. So I just change it to a generic name like El Capitan or Mojave. To add in spaces in the new host name, enclose the word in double quotes.

3 Likes

Do macs have anything like linux’ .profile files? Where you don’t bother changing the username/hostname but simply the prompt?

From what I read, Stomme, macs overwrite their profile files at boot with what’s kept by scutil, but I don’t own a mac so I can’t test this random internet research.

Yes, but .profile and .bash_profile are both are usually for startup commands from my experience. Whereas with the host name, you can do it by just changing the terminal. Also, .profile doesn’t exist so you have to create it yourself. I believe .bash_profile does exist. And as far as I know, changing the prompt name does change the host name as well since they tie together.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.