Terminal · macOS app

Also known as: Terminal app

On this page 7

Terminal is the macOS app that Apple ships in the Utilities folder to give users a text-based command-line interface to the operating system. The Terminal app emulates a classic hardware terminal, starts a shell (by default zsh), and passes typed commands to it, which makes it the entry point for Terminal & scripting work on macOS.

The Terminal app itself does not execute commands. It draws text, handles keyboard input, manages windows and tabs, and connects them to shell processes through a pseudo-terminal. This page covers the Apple application only; the general concept of a terminal on Linux is described separately.

How the Terminal app connects to the shell

When a new window opens, the Terminal app creates a pseudo-terminal device pair and launches the user’s login shell on it. Everything typed goes to the shell through this device, and everything the shell or its programs print comes back to be rendered in the window. Programs such as top or vim use escape sequences to move the cursor and change colors, and the Terminal app interprets them as an xterm-compatible emulator.

Since macOS Catalina, the default shell for new accounts is zsh, replacing bash. Apple still includes an old bash 3.2 for compatibility, because newer bash versions use the GPLv3 license. The shell can be changed per user in System Settings or with the chsh command.

LayerWhat it doesExample
Terminal appDraws text and captures keystrokesWindow, tabs, profiles
Pseudo-terminalCarries input and output bytesA /dev/ttys device
ShellParses and runs commandszsh, bash
Commands and toolsPerform the actual workls, diskutil, defaults
macOS kernelManages processes and filesXNU
Layers involved when a command runs

Features and settings of Terminal on macOS

Terminal offers profiles, which are saved sets of fonts, colors, window size, cursor style and shell behavior. A profile can run a startup command automatically, and different profiles can be assigned to different windows, which helps users visually separate local work from remote sessions.

Other built-in features include tabs and window groups, split panes within a window, Secure Keyboard Entry that blocks other apps from reading keystrokes, marks and bookmarks for jumping through long output, and window restoration after restart. Terminal also integrates with Finder: dragging a file into a window inserts its full path.

SettingLocationEffect
Default profileSettings, ProfilesLook and behavior of new windows
Shells open withSettings, GeneralDefault or custom shell path
Secure Keyboard EntryTerminal menuProtects typed passwords from other apps
Use Option as Meta keyProfile, KeyboardEnables Emacs-style shortcuts
Scrollback limitProfile, WindowNumber of lines kept in history
When the shell exitsProfile, ShellClose window or keep it open
Useful Terminal settings and what they control

Many settings can also be scripted. The defaults tool reads and writes the Terminal preference domain com.apple.Terminal, and AppleScript can open windows and send commands, which allows automated setups for new machines.

Terminal is the default, always-available choice, but it is not the only terminal emulator for the Mac. Power users often compare it with third-party apps, while scripting tools such as Script Editor solve a related but different problem.

ToolTypeTypical reason to choose it
TerminalBuilt-in terminal emulatorPreinstalled, stable, well integrated
iTerm2Third-party terminal emulatorAdvanced splits, search, triggers
GPU-accelerated emulatorsThird-party terminal emulatorsFast rendering of heavy output
Script EditorAppleScript and JXA editorAutomating apps rather than shells
ShortcutsVisual automation appWorkflows without writing code
Terminal and comparable tools

Whatever emulator is used, the shell and the command-line tools underneath are the same. A script written and tested in the Terminal app runs unchanged in iTerm2, because the emulator only changes the presentation, not the behavior of commands.

Common tasks performed in Terminal

Terminal gives direct access to macOS-specific command-line tools that have no full graphical equivalent. Administrators and developers use it daily for diagnostics, configuration and package installation, often through tools listed below.

TaskCommandPurpose
Change hidden preferencesdefaults writeAdjust settings not shown in the interface
Manage disksdiskutil listInspect, erase or repair volumes
Search with SpotlightmdfindQuery the Spotlight index
Prevent sleepcaffeinateKeep the Mac awake during long jobs
Install developer toolsxcode-select --installAdd compilers and Git
Update the systemsoftwareupdate -lList and install macOS updates
Typical macOS tasks and the commands behind them

Package managers such as Homebrew and MacPorts are also installed and operated from Terminal. They add open-source tools that macOS does not ship, and they typically require the Xcode Command Line Tools first.

Permissions, risks and common mistakes

Terminal runs commands with the privileges of the logged-in user, and sudo raises them to administrator level after a password prompt. Because a single mistyped command can delete files or change system settings, users should understand any command before pasting it, especially commands copied from web pages.

macOS adds protective layers. Transparency, Consent and Control (TCC) blocks access to protected folders such as Desktop, Documents and Mail data until the user grants Terminal Full Disk Access or a specific permission. System Integrity Protection prevents even root from modifying core system files, which is why some old tutorials fail on current macOS releases.

  • Pasting unknown commands: social-engineering attacks often ask users to paste a malicious one-liner.
  • Granting Full Disk Access casually: it extends to every program launched from Terminal.
  • Assuming bash syntax: some bash scripts behave differently under zsh.
  • Forgetting quotes around paths: file names with spaces break unquoted commands.

In everyday language

Terminal is a window where you talk to your Mac in typed words instead of clicking. You type an instruction, press Return, and the Mac answers with text.

It is a bit like phoning a very literal assistant who follows instructions exactly. That makes it fast and powerful, but also means it will not ask whether you really meant something risky. Most people never need it, yet it is always there when a precise task calls for it.

Seen in the real world

An IT technician at a design studio prepares twelve new MacBook laptops for staff. Clicking through the same settings on each machine would take most of a day, so she opens Terminal and runs a short zsh script she maintains.

The script installs the Xcode Command Line Tools and Homebrew, adds the studio’s standard utilities, shows hidden file extensions with defaults write, and confirms the disk layout with diskutil list. She grants Terminal Full Disk Access only for the setup session and removes it afterward.

Each laptop is configured in about fifteen minutes, every machine ends up with identical settings, and the script is reused for the next hiring wave.