Adjust system settings from the command line #
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