Useful Commands

Here is a list of commands that can be helpful in administration and troubleshooting on Mac’s:

Desktop, Dock & LaunchPad
  • defaults write ResetLaunchPad -bool true; killall Dock # reset LaunchPad
  • defaults delete; killall Dock # reset the Dock
Imaging / Deployment
  • softwareupdate --list-full-installers # display available macOS installers for download
  • softwareupdate --fetch-full-installer --full-installer-version **.**.* # download a specific macOS version installer
Sharing & Services
  • sudo launchctl print system/ # list all services
  • sudo scutil --set HostName “Host Name” # set hostname (useful if there is a mismatch between sharing preferences and the shell
  • sudo launchctl load -w /System/Library/LaunchDaemons/ # enable AFP sharing on macOS Catalina and earlier
  • sudo launchctl load -w /System/Library/LaunchDaemons/ # enable SMB file sharing