MacOS
Information
Show operating system version
sw_versView and set macOS system settings
sudo systemsetupDisk Utility
List available internal / external disk volumes
diskutil listShow / delete APFS snapshot for volume
diskutil apfs listSnapshots <volume>
diskutil apfs deleteSnapshot <volume> -name <snapshot-name>Power Metrics
Show all system power / hardware metrics (CPU, GPU, Network etc)
sudo powermetricsShow specific power metrics (eg. smc for System Management Controller stats)
sudo powermetrics --samplers smcPower Settings
Show current power settings in use
pmset -gShow power information for battery and ac adapter
pmset -g batt
pmset -g acList sleep and wake counts since boot
pmset -g statsOutput all power setting stats
pmset -g everythingSystem Integrity Protection
Show System Integrity Protection status
csrutil statusEnable / Disable System Integrity Protection (requires Safe Mode to run)
csrutil enable
csrutil disableSystem and Kernel Extensions
List user daemons, agents and XPC services (list all / list third party only)
launchctl list
launchctl list | grep -v com.appleList system daemons, agents and XPC services
sudo launchctl listList system extensions
systemextensionsctl listList kernel extensions (list all / list third party only)
kextstat
kextstat | grep -v com.appleUnload kernel extension
sudo kextunload <extension.kext>Location of kernel extension files
/System/Library/Extensions
/Library/ExtensionsSystem Paths
Location of default macOS system $PATH entries
/etc/paths
/etc/paths.dSystem Profiler
Report detailed system configuration (-detailLevel mini, basic, full)
system_profilerList all available profile data types
system_profiler -listDataTypesSystem hardware and software summary
system_profiler SPHardwareDataType
system_profiler SPSoftwareDataTypeOther system information (storage, memory, display, audio, network, battery, USB, bluetooth)
system_profiler SPStorageDataType
system_profiler SPMemoryDataType
system_profiler SPDisplaysDataType
system_profiler SPAudioDataType
system_profiler SPNetworkDataType
system_profiler SPPowerDataType
system_profiler SPUSBDataType
system_profiler SPBluetoothDataTypeTroubleshooting
Relaunch Mac OS features
killall Dock
killall Finder
killall ControlStripRosetta
Show Rosetta process if installed and available
pgrep oahdClipboard
Copy input content to the clipboard
pbcopyExamples for copy to clipboard from files
pbcopy < <file>
cat <file> | pbcopyOutputs the current contents of the clipboard
pbpasteSpotlight
Search spotlight file contents and names (or file name only via -name)
mdfind <search-a> <search-b>
mdfind -name <search>Filter for specific file type (eg. image)
mdfind kind:<type>
mdfind kind:imageLimit search to specific directory
mdfind -onlyin <directory> <search>Screen Capture
Capture entire screen to file (default format: PNG)
screencapture <file>Activate interactive screen capture mode (CTRL clipboard, SPACE selection/window, ESC cancel)
screencapture -i <file>Other useful screen capture options
-t <format>png, pdf, jpg-cSend to clipboard-PSend to Preview app-SCapture screen instead of window-oExclude window shadow-T <secs>Capture after elapsed seconds
Extended Attributes
Show macOS extended attributes for file
xattr -l <file>Locked Files
macOS allows locking files via Finder to prevent accidental deletion and editing (Note: This setting prevents changes via sudo)
File -> Get Info -> LockedApp Store
Show software update history (--all includes initial app installs)
softwareupdate --history
softwareupdate --history --allList available software updates
softwareupdate -lInstall specific software update
softwareupdate -i <package>Install all available software updates (-r only recommend updates, -R auto restart if required)
softwareupdate -iaDownload update or cancel in progress download without installing
softwareupdate -d <package>
softwareupdate -e <package>Force App Store updater to remove pending updates (useful if update is in looped state and not installing)
softwareupdate --clear-catalogIgnore specific package update
softwareupdate --ignore <package>Clear ignored packages list
softwareupdate --reset-ignoredSystem Defaults
List defaults preference files (or list as one per line)
defaults domains
defaults domains | tr ',' '\n'Show current defaults for domain
defaults read <domain>Show expected type for domain setting
defaults read-type <domain> <key>Set specific domain key
defaults write <domain> <key> <value>
defaults write <domain> <key> -<type> <value>Quick Look
Open quick look for file
qlmanage -p <file>List all registered quick look plugins (includes ones provided internally by apps)
qlmanage -mDirectories for stand along quick look providers
/Library/QuickLook
~/Library/QuickLookmacOS Firewall Settings
List firewall rules
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --listappsAdd or remove app from firewall rules
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add <app-path>
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --remove <app-path>Block or unblock app in firewall rules
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --blockapp <app-path>
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp <app-path>Security and Privacy Permissions
Manage associated app permissions (listed in System Preferences -> Security & Privacy -> Privacy)
Reset app access permissions for category
tccutil reset <app-category>Reset specific app access permissions for category
tccutil reset <app-category> <app-bundle-id>Available app categories
AccessibilityAddressBookAppleEventsCalendarCameraMicrophonePhotosRemindersScreenCaptureSystemPolicyAllFilesSystemPolicyDesktopFolderSystemPolicyDeveloperFilesSystemPolicyDocumentsFolderSystemPolicyDownloadsFolderSystemPolicyNetworkVolumesSystemPolicyRemovableVolumesSystemPolicySysAdminFiles
SF Mono Fonts
Xcode SF Mono font assets
/Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/Fonts/Terminal SF Mono font assets
/Applications/Utilities/Terminal.app/Contents/Resources/FontsLast updated