The last command allows you to display the last (and currently) logged in users. It displays the user name, the terminal name, the remote host name (if available) and the login and logout times.
Syntax
last [-n number] [-f filename] [-a] [name | tty] |
Maximum number of records to be displayed. By default all records will be displayed.
Name of the wtmpx/utmpx file to be used; default: /var/adm/wtmpx.
Alternative output layout; the host name will be output in the rightmost column. Thus the host name will not be truncated in case of fully qualified DNS names.
Only records concerning the specified user or terminal name are output. A special record with the user name |
File
/var/adm/wtmpx File with all currently and previously logged in users.. /var/adm/utmpx File with all currently logged in users. |
Example 1
Show all information from /var/adm/wtmpx:
|
Example 2
Show all information on currently logged in users:
|
Example 3
Show login information on user FROEDE in alternative output format:
|
Example 4
Show information on the last reboot:
|
See also
who |