Skip to content

Instantly share code, notes, and snippets.

@tutumagi
Created October 21, 2019 09:34
Show Gist options
  • Save tutumagi/d1773a62f1f5680e05905cee4178c979 to your computer and use it in GitHub Desktop.
Save tutumagi/d1773a62f1f5680e05905cee4178c979 to your computer and use it in GitHub Desktop.
modify terminal hostname

link

details

if you use

sudo scutil --set HostName name-you-want

it will work a bit better. From the scutil(8) man page:

--get pref
    Retrieves the specified preference.  The current value will be
    reported on standard output.

    Supported preferences include:
          ComputerName   The user-friendly name for the system.
          LocalHostName  The local (Bonjour) host name.
          HostName       The name associated with hostname(1) and gethostname(3).

--set pref [newval]
    Updates the specified preference with the new value.  If the new value is not
    specified on the command line then it will be read from standard input.

    Supported preferences include: ComputerName LocalHostName HostName

    The --set option requires super-user access. 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment