Back to the command reference

last

UsersFundamentals In real Linux

Show recent logins

Name: last: the latest logins

This command needs a real Linux system; you can practise it in real Linux mode.

Full man page

Description

last shows recent logins and logouts from /var/log/wtmp, including reboots (last reboot); useful for security audits.

Syntax

last [OPTION]... [USER]

Common options

-n / --limit NUMShow N entries
USEROnly one user’s logins
rebootShow reboots
-x / --systemAlso show shutdowns and run-level changes
-F / --fulltimesFull login and logout dates and times
-i / --ipShow addresses instead of host names
-s / --since TIMEOnly since a time, e.g. -s yesterday

Examples

  • $ last -n 10

    The last 10 logins

    Explain
  • $ last reboot

    When the system rebooted

    Explain

Related