MacOS

Information

Show operating system version

sw_vers

View and set macOS system settings

sudo systemsetup

Disk Utility

List available internal / external disk volumes

diskutil list

Show / 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 powermetrics

Show specific power metrics (eg. smc for System Management Controller stats)

Power Settings

Show current power settings in use

Show power information for battery and ac adapter

List sleep and wake counts since boot

Output all power setting stats

System Integrity Protection

Show System Integrity Protection status

Enable / Disable System Integrity Protection (requires Safe Mode to run)

System and Kernel Extensions

List user daemons, agents and XPC services (list all / list third party only)

List system daemons, agents and XPC services

List system extensions

List kernel extensions (list all / list third party only)

Unload kernel extension

Location of kernel extension files

System Paths

Location of default macOS system $PATH entries

System Profiler

Report detailed system configuration (-detailLevel mini, basic, full)

List all available profile data types

System hardware and software summary

Other system information (storage, memory, display, audio, network, battery, USB, bluetooth)

Troubleshooting

Relaunch Mac OS features

Rosetta

Show Rosetta process if installed and available

Clipboard

Copy input content to the clipboard

Examples for copy to clipboard from files

Outputs the current contents of the clipboard

Spotlight

Search spotlight file contents and names (or file name only via -name)

Filter for specific file type (eg. image)

Limit search to specific directory

Screen Capture

Capture entire screen to file (default format: PNG)

Activate interactive screen capture mode (CTRL clipboard, SPACE selection/window, ESC cancel)

Other useful screen capture options

  • -t <format> png, pdf, jpg

  • -c Send to clipboard

  • -P Send to Preview app

  • -S Capture screen instead of window

  • -o Exclude window shadow

  • -T <secs> Capture after elapsed seconds

Extended Attributes

Show macOS extended attributes for file

Locked Files

macOS allows locking files via Finder to prevent accidental deletion and editing (Note: This setting prevents changes via sudo)

App Store

Show software update history (--all includes initial app installs)

List available software updates

Install specific software update

Install all available software updates (-r only recommend updates, -R auto restart if required)

Download update or cancel in progress download without installing

Force App Store updater to remove pending updates (useful if update is in looped state and not installing)

Ignore specific package update

Clear ignored packages list

System Defaults

List defaults preference files (or list as one per line)

Show current defaults for domain

Show expected type for domain setting

Set specific domain key

Quick Look

Open quick look for file

List all registered quick look plugins (includes ones provided internally by apps)

Directories for stand along quick look providers

macOS Firewall Settings

List firewall rules

Add or remove app from firewall rules

Block or unblock app in firewall rules

Security and Privacy Permissions

Manage associated app permissions (listed in System Preferences -> Security & Privacy -> Privacy)

Reset app access permissions for category

Reset specific app access permissions for category

Available app categories

  • Accessibility

  • AddressBook

  • AppleEvents

  • Calendar

  • Camera

  • Microphone

  • Photos

  • Reminders

  • ScreenCapture

  • SystemPolicyAllFiles

  • SystemPolicyDesktopFolder

  • SystemPolicyDeveloperFiles

  • SystemPolicyDocumentsFolder

  • SystemPolicyDownloadsFolder

  • SystemPolicyNetworkVolumes

  • SystemPolicyRemovableVolumes

  • SystemPolicySysAdminFiles

SF Mono Fonts

Xcode SF Mono font assets

Terminal SF Mono font assets

Last updated