Change hostname that shows up on CLI

  • Last tested on OS X El Capitan 10.11.5
  • Base reference: Larry Gordon

The hostname doesn't seem to change in spite of changing the computer name in Sharing preference, and NetBIOS names. This command has to be executed at the CLI to change the hostname.

$ sudo scutil --set HostName newhostname.local