Review Recent Login History with last
See the last logins, reboots, and shutdowns recorded on your Mac.
Run `last -20` to show the 20 most recent sessions.
01Command
Command
$ last -2002What 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
!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 — indicate last logins of users and terminals (macOS man page)Evidence: Documents last listing sessions recorded in the system accounting file, most recent first.
Last verified: 2026-09-18 · Category: Security & Privacy
06Related solutions
Rebuild the Spotlight index on Mac
Erase the broken Spotlight database so macOS re-indexes your drive from scratch.
Find your Mac's serial number from the Terminal
Read the serial number, model identifier and chip without opening About This Mac.
Check your MacBook's battery cycle count
See how many charge cycles the battery has used and its health condition.