last - indicate last logins of users and ttys
last [-#] [-T] [-d [[CC]YY[MM[DD[hh]]]]mm[.ss]]
[-f file] [-h host] [-t tty] [user ...]
The last(1) utility will either (1) list the sessions of specified users, ttys, and hosts, in reverse time order; or (2) list the users logged in at a specified snapshot date and time in reverse-time order. Each line of output contains the user name, the tty from which the session was conducted, any host name, the start and stop times for the session, and the duration of the session. If the session is still continuing or was cut short by a crash or shutdown, last(1) will so indicate.
[[CC]YY][MMDD]hhmm[.SS]
where each pair of letters represents the following:
If the CC and YY letter pairs are not specified, the values default to the current year. If the SS letter pair is not specified, the value defaults to 0.
If multiple arguments are given, and a snapshot time is not specified, the information that applies to any of the arguments is printed. Thus, last -t console root would list all of root's sessions as well as all sessions on the console terminal. If no users, host names, or terminals are specified, last(1) prints a record of all logins and logouts.
The pseudo user reboot logs in at reboots of the system. Thus, last reboot gives an indication of mean time between reboot.
If last(1) is interrupted, it indicates to what date the search has progressed. If interrupted with a quit signal last(1) indicates how far the search has progressed and then continues.
utmpx(5)