LASTLOG2(8)
β¨ LASTLOG2 π
okay so bestie, welcome to lastlog2 β that's section 8 of the manual, the User Commands girlies, and she is literally the main character of "when did everyone last log in" π
πΈ 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, like, just vibing with zero options) 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. (ghost user behaviour fr fr π»)
Only the entries for the current users of the system are displayed. Other entries may exist for users that have meanwhile been deleted β RIP to them, but they're not on this list π
Compared to lastlog(8), this command is Y2038-safe, and uses SQLite3 instead of a sparse file to store the information. no cap, she is future-proofed π₯
β¨ OPTIONS β¨
-a,--activeβ Do not print entries for users who have never logged in. only the ones who actually showed up π-b,--beforedays β Print only the last-login records older than days. ancient history only πΊ-C,--clearβ Clear the last-login record of a user. This option can only be used together with-u(--user). she does NOT fly solo π«-d,--databasefile β Use file as lastlog2 database. pick your own database, entrepreneur energy π-i,--importfile β Import data from an old lastlog file named file. Existing entries in the lastlog2 database will be overwritten. β οΈ yes bestie, overwritten β say bye to what was there π-r,--renamenewname β Rename the user given with-uto this newname. This option can only be used together with-u(--user). glow-up era, new name who dis β¨-s,--serviceβ Display the PAM service used to login in the last column. receipts on how they got in π-S,--setβ Set the last-login record of a user to the current time. This option can only be used together with-u(--user). time-travel, but make it now β°-t,--timedays β Print only last-login records more recent than days. fresh entries only, no stale vibes π₯-u,--userlogin β Print (or modify) the last-login record of the user login. the VIP pass to one specific person π-h,--helpβ Display help text and exit. π«Ά-V,--versionβ Display version and exit. β
π FILES π
/var/lib/lastlog/lastlog2.dbβ Lastlog2 logging database file ποΈ
π AUTHORS π
lastlog2 was written by Thorsten Kukuk for liblastlog2(3). king behaviour, we stan π
π¦ SEE ALSO π¦
liblastlog2(3)
(iykyk, go read the library page too π)
π REPORTING BUGS π
For bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>. don't be shy, tell them what broke π
β 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/>. go get her π§
π and that's the whole page bestie β sourced from util-linux 2.42.2, dated 2026-06-16, filed under LASTLOG2(8). now go check who's been logging in ππ
π¦ where this page comes from
- ubuntu stonking: lastlog2 2.42.2-1ubuntu2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms