Terminal Dojo
Help العربية Sign inGet started

Command library / last

last

BashDraft — pending expert review3 practice missions

Show the login history for this host

Reads /var/log/wtmp and prints who logged in, from where, and when — including still-active sessions. Give it a username to see only that account's history, which is one of the fastest ways to check whether an account was used when it shouldn't have been.

Practice last

Usage

last [-n N] [username]

Options and flags

Examples

Common mistakes

last -n last -n 10

-n needs a number right after it — how many entries to show — or it has nothing to limit by.

Related commands

journalctl