Show recent macOS logs for a process
Build a paste-ready command, then review its compatibility and effects before running it.
log show --last 30m --style compact --predicate 'process == "sshd"' | tail -30read-onlyno known side effects Compatibility
macOSVerified for macOS using zsh, bash syntax.
Operational knowledgereview due 2027-01-20
Requirementsloglog must be installed and available on PATH.
Version supportlog Current supported releasesVerified for macos using zsh, bash syntax; consult compatibility notes for platform-specific differences.
Expected signals2026-07-24 12:04:11.103 Df sshd[1204:4c2] [com.openssh.sshd] Accepted publickey for alexRepresentative successful output; values vary with the selected target and system state.
Known errorslog: command not foundlog is missing or is not available on PATH.
Verifylog show --last 30m --style compact --predicate 'process == "sshd"' | tail -30The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01logCommandRuns the log stage of this one-liner.
02showArgumentPasses show to log.
03--lastOptionConfigures log with the --last option.
0430mArgumentPasses 30m to log.
05--styleOptionConfigures log with the --style option.
06compactArgumentPasses compact to log.
07--predicateOptionConfigures log with the --predicate option.
08'process == "sshd"'ArgumentPasses 'process == "sshd"' to log.
09|PipelinePasses the output on the left to the command on the right.
10tailCommandRuns the tail stage of this one-liner.
11-30OptionConfigures tail with the -30 option.
Example input
log show --last 30m --style compact --predicate 'process == "sshd"' | tail -30
Example output
2026-07-24 12:04:11.103 Df sshd[1204:4c2] [com.openssh.sshd] Accepted publickey for alex
Illustrative output — exact values vary by system and data.
Official sources