Adjust system settings from the command line #

Last updated March 16, 2026
macos

Settings can be configured with the defaults command and the key representing that particular setting. See macOS defaults for more info.

ex:

# read the current orientation
defaults read com.apple.dock "orientation"
# position the dock on the left side of the screen
defaults write com.apple.dock "orientation" -string "left"
# restart the Dock
killall Dock 

set the default location for screenshots

# set to ~/Desktop
defaults write com.apple.screencapture "location" -string "~/Documents/Screenshots"
# restart system ui server
killall SystemUIServer