Scroll to navigation

LASTLOG2(8) lastlog2 LASTLOG2(8)

NAME

lastlog2 - display date of last login for all users or a specific one

SYNOPSIS

lastlog2 [option...]

DESCRIPTION

lastlog2 displays the content of the last login database. The login name, last login time, tty and remote host will be printed. The default (no flags) causes all last login entries to be printed, sorted by the order as written the first time into the database.

Compared to lastlog this command is Y2038 safe and uses sqlite3 to store the information and not a sparse file.

OPTIONS

-b, --before DAYS

Print only last login records older than DAYS.

-C, --clear

Clear last login record of a user. This option can be used only together with -u (--user).

-d, --database FILE

Use FILE as lastlog2 database.

-h, --help

Display help message and exit.

-i, --import FILE

Import data from old lastlog file FILE. Existing entries in the lastlog2 database will be overwritten.

-r, --rename NEWNAME

Rename existing user to NEWNAME. This option can only be used together with -u (--user).

-s, --service

Display PAM service used to login in the last column.

-S, --set

Set last login record of a user to the current time. This option can only be used together with -u (--user).

-t, --time DAYS

Print only last login records more recent than DAYS.

-u, --user LOGIN

Print only the last login record of the user LOGIN.

-v, --version

Print version number and exit.

If the user has never logged in the message **Never logged in** will be displayed in the latest login time row.

Only the entries for the current users of the system will be displayed. Other entries may exist for users that were deleted previously.

FILES

/var/lib/lastlog/lastlog2.db

Lastlog2 logging database file

SEE ALSO

pam_lastlog2(8),

AUTHOR

lastlog2 was written by Thorsten Kukuk <kukuk@suse.com>.

02/16/2024 lastlog2 1.3.1