Review Recent Login History with last

See the last logins, reboots, and shutdowns recorded on your Mac.

macOSlogssecurityDiagnosticsLow risk
Run `last -20` to show the 20 most recent sessions.

01Command

Command
$ last -20

02What it does

Every console login, logout, and reboot is recorded in the system's accounting log, and last prints them newest-first with session durations. It's a quick way to confirm whether someone used the Mac while you were away, or when the last shutdown happened. Add a username (e.g. `last alice`) to see only that account's sessions.

03Risk

RiskLow risk
!Warning: Entries only appear for local logins recorded by the system accounting file — screen sharing and SSH sessions show up, but file-sharing connections do not.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-18 · Category: Security & Privacy

06Related solutions