One-Shot CPU Snapshot with top
Print a single top-style report sorted by CPU instead of watching a live updating screen.
Run top -l 1 -o cpu to take one sample and print processes ordered by current CPU usage, heaviest first.
01Command
Command
$ top -l 1 -o cpu02What it does
By default top redraws the terminal continuously, which is awkward in scripts and screenshots. The -l 1 option puts it in logging mode: it takes exactly one sample, prints the report, and exits. Adding -o cpu sorts the process table by CPU usage so the busiest processes appear at the top of the list.
03Risk
!Warning: The very first -l sample often shows low or zero CPU percentages because macOS top needs two samples to compute usage deltas; run top -l 2 and read the second, or use -stats pid,command,cpu to trim the columns.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- top — display and update sorted information about processes (macOS)Evidence: The page documents -l for logging mode (one shot) and notes that -u is an alias equivalent to "-o cpu -O time", confirming -o cpu sorts by CPU usage.
- top(1) man pageEvidence: The synopsis shows -l <samples> ("Use logging mode and display <samples> samples") and -o <key> for the sort-order column, with cpu as a valid key.
Last verified: 2026-09-19 · Category: System & Settings