OS X’s scutil
Posted by Bash, Code, Command-Line, OS X | Posted on 17-07-2009
| Posted inscutil is OS X’s way of managing system configuration parameters. These parameters not only include HostName, ComputerName, LocalHostName, but basically anything that the configd daemon uses.
Most of those files are located in
/System/Library/SystemConfiguration/ /Library/Preferences/SystemConfiguration/ .../preferences/ .../NetworkInterfaces/ .../VirturalNetworkInterfaces/
To enter the scutil prompt, type
/usr/sbin/scutil
To view all the scutil commands, type
> help
To get a list of all the scutil keys, type “list” or “list + [Pattern]”
> list
To view the contents of a key, type “show + [Pattern”
> show Setup:/Network/Global/IPv4
This will result in a pattern like this.
< dictionary > { ServiceOrder : { 0 : 59267386-49A6-401F-A23E-BE372AD748EB 1 : 68719F97-53F0-479E-A497-8A3B809728D1 2 : E936454A-40CA-4867-A759-61D6C38F5972 } }
To get your computer name, local host name or host name type,
/usr/sbin/scutil --get ComputerName /usr/sbin/scutil --get LocalHostName /usr/sbin/scutil --get HostName
And setting those names are just as easy.
/usr/sbin/scutil --set ComputerName NEWNAME /usr/sbin/scutil --set LocalHostName NEWNAME /usr/sbin/scutil --set HostName NEWNAME
On a side note. ComputerName HostName can be set to blank, but LocalHostName needs at least 1 character.
To quit scutil type,
> quit
Family Commands of scutil are
/usr/sbin/scutil -- Manage system configuration parameters /usr/sbin/scselect -- Select system configuration "location" /usr/sbin/configd -- -- System Configuration Daemon
Very helpful. Other blogs have this info too, but yours is the only one that puts it in a complete, concise format!