| LASTLOG2(8) | User Commands | LASTLOG2(8) |
NAME
lastlog2 - displays date of last login for all users or a specific one
SYNOPSIS
lastlog2 [options]
DESCRIPTION
lastlog2 displays the content of the last-login database. The login-name, last-login-time, tty and remote-host will be printed. By default (no flags) all last-login entries are printed, in the order they were first written into the database.
If a user has never logged in, the message **Never logged in** is displayed in the last-login-time column.
Only the entries for the current users of the system are displayed. Other entries may exist for users that have meanwhile been deleted.
Compared to lastlog(8), this command is Y2038-safe, and uses SQLite3 instead of a sparse file to store the information.
OPTIONS
-a, --active
-b, --before days
-C, --clear
-d, --database file
-i, --import file
-r, --rename newname
-s, --service
-S, --set
-t, --time days
-u, --user login
-h, --help
-V, --version
FILES
/var/lib/lastlog/lastlog2.db
AUTHORS
lastlog2 was written by Thorsten Kukuk for liblastlog2(3).
SEE ALSO
REPORTING BUGS
For bug reports, use the issue tracker https://github.com/util-linux/util-linux/issues.
AVAILABILITY
The lastlog2 command is part of the util-linux package which can be downloaded from Linux Kernel Archive https://www.kernel.org/pub/linux/utils/util-linux/.
| 2026-04-01 | util-linux 2.42 |