last flags & options

Basic usage

Show recent logins.

last

-n

Limit output to N entries.

last -n 10

Specific user

Show logins for a specific user.

last username

-a, --hostlast

Show the hostname in the last column.

last -a

-F, --fullnames

Show full login and logout times.

last -F

-x, --system

Show system shutdown and runlevel changes.

last -x

-d, --dns

Translate IPs to hostnames.

last -d

-f, --file

Read from a specific wtmp file instead of the default.

last -f /var/log/wtmp.1

-s, --since / -t, --until

Show logins within a time range.

last -s 2025-01-01 -t 2025-02-01

Show reboots

last reboot