systemsetup - macOS


Overview

The systemsetup command is a versatile tool used to manage various system settings and configurations on macOS. It allows users to modify system-wide preferences, hardware settings, and other essential parameters.

Syntax

systemsetup [options] [parameters]

Options/Flags

  • -get (-g): Retrieves the current value of a system setting.
  • -set (-s): Sets a new value for a system setting.
  • -delete (-d): Deletes a system setting.
  • -restart (-r): Restarts the computer after applying changes.
  • -shutdown (-sh): Shuts down the computer after applying changes.
  • -nvram (-n): Specifies NVRAM (non-volatile RAM) as the target.
  • -prefs (-p): Specifies System Preferences as the target.

Examples

Set a new computer name:

systemsetup -setcomputername "NewComputerName"

Get the current boot volume:

systemsetup -getstartupdisk

Delete the NVRAM setting for “SystemAudioVolume”:

systemsetup -delete -nvram SystemAudioVolume

Restart the computer with a 30-second delay:

systemsetup -restart -delay 30

Common Issues

  • Invalid parameter values: Ensure the values provided for system settings are valid.
  • Permission denied: Some settings may require elevated privileges (using sudo).
  • Setting not found: Verify that the setting you are trying to modify exists.

Integration

systemsetup can be integrated into scripts or automated tasks to configure macOS systems programmatically. It can be combined with other commands, such as scutil and pmset, for more advanced system management.

  • scutil: Manages network and networking services.
  • pmset: Controls power management settings.