Computer Name in OSX


I was wonderign if it was possible to change the computer name via a command line in OSX. I'm trying to write a script for easing imaging deployment of several hundred new iBooks and being able to change the name via a command line would make my job a lot easier...


Crotchety UI Nitpicker
It should be possible using the "defaults" command, but I'm not sure of the syntax used for adding items to nested dictionaries. I know that the particular option you need to change is in "/Library/Preferences/SystemConfiguration/preferences.plist", and the tag is embedded within the plist in System > System > ComputerName.

All I can say is it would look something like sudo defaults write "/Library/Preferences/SystemConfiguration/preferences" <some parameters I'm not quite sure of here>. You're probably more at home with Terminal than I am, so maybe "man defaults" is all you'll need to take it from there.

Hope this helps.