lastlogin will list the last login session of specified
users, or for all users by default. Each line of output contains the user name, the tty from which the session was conducted, any hostname, and the start time for the session.
If multiple
users are given, the session information for each user is printed in the order given on the command line. Otherwise, information for all users is printed, sorted by uid.
lastlogin differs from
last(1) in that it only prints information regarding the very last login session. The last login database is never turned over or deleted in standard usage.
The following options are available:
-f filename
Process input from
filename. If the file ends with an “x”, then it is assumed that it is a
lastlogx(5) file, else it is assumed to be a
lastlog(5) file.
-H hostlen
Set the field width for host output to hostlen characters.
-L linelen
Set the field width for line output to linelen characters.
-N namelen
Set the field width for name output to namelen characters.
-n
Attempt to print numeric host addresses. This option is only supported with
lastlogx(5) format files.
-r
Reverse the order of the sort.
-t
Sort by last login time (most recent first.)