Here is a list of commands that can be helpful in administration and troubleshooting on Mac’s:
Desktop, Dock & LaunchPad
defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock # reset LaunchPad
defaults delete com.apple.dock; 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/com.apple.AppleFileServer.plist # enable AFP sharing on macOS Catalina and earlier
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.smbd.plist # enable SMB file sharing