The macOS command line and automation: Terminal, zsh, Homebrew, defaults, AppleScript and Shortcuts.
21 terms
AppleScript is the English-like scripting language of macOS that automates apps and system tasks by sending them Apple events.
The caffeinate command in macOS Terminal keeps a Mac awake by holding power management assertions for a set time or while a process runs.
csrutil is the macOS command-line tool that reports and changes System Integrity Protection, the kernel-enforced guard on protected system files.
The defaults macOS command reads, writes and deletes preference values in property list domains, enabling scripted and hidden configuration changes.
diskutil is the macOS command-line tool for listing, partitioning, formatting, mounting, repairing and erasing disks, volumes and APFS containers.
hdiutil is the macOS command-line tool that creates, converts, attaches, verifies and resizes disk images such as DMG, sparse bundle and ISO files.
JavaScript for Automation (JXA) is the macOS scripting language that controls apps through Apple events using JavaScript instead of AppleScript syntax.
A launch agent in macOS is a launchd job defined by a property list that runs a program in the context of a logged-in user session.
A launch daemon is a macOS background job that launchd starts as root at boot, defined by a property list in /Library/LaunchDaemons.
launchctl is the macOS command-line tool that loads, starts, stops and inspects launchd services such as launch agents and launch daemons.
MacPorts is an open-source package manager for macOS that builds and installs Unix software from Portfiles into an isolated prefix under /opt/local.
mdfind is the macOS command-line tool that queries the Spotlight metadata index to find files by name, content or attributes in seconds.
networksetup is the macOS command-line tool that reads and changes persistent network settings such as IP addresses, DNS servers, proxies and Wi-Fi.
The open macOS command opens files, folders, URLs and applications from Terminal exactly as a double-click in Finder would, using Launch Services rules.
osascript is the macOS command-line tool that runs AppleScript and JavaScript for Automation code from Terminal, shell scripts and scheduled jobs.
pbcopy is a macOS command that copies standard input to the system clipboard, while its companion pbpaste prints clipboard contents in Terminal.
softwareupdate is the macOS command for listing, downloading and installing Apple system updates, Rosetta and full installers from Terminal.
spctl is the macOS command-line tool that queries and manages Gatekeeper, the security assessment policy that decides whether software may run.
Terminal is the built-in macOS app that provides a command-line window to the zsh shell for running commands, scripts and system tools on a Mac.
tmutil is the macOS command-line tool that controls Time Machine, letting admins start backups, set destinations, manage exclusions and snapshots.
Xcode Command Line Tools is the standalone macOS package that installs Clang, Git, make and the SDK headers needed to build software in Terminal.