last - display login and logout information about users and terminals
The last command looks in the /var/adm/wtmpx file, which
records all logins and logouts, for information about a
user, a terminal, or any group of users and terminals. Argu-
ments specify names of users or terminals of interest. If
multiple arguments are given, the information applicable to
any of the arguments is printed. For example, last root con-
sole lists all of root's sessions, as well as all sessions
on the console terminal. last displays the sessions of the
specified users and terminals, most recent first, indicating
the times at which the session began, the duration of the
session, and the terminal on which the session took place.
last also indicates whether the session is continuing or was
cut short by a reboot.
example:
Code:
root@mp-wst01 # last -a | more
pressy pts/3 Wed Mar 21 18:53 still logged in pressynb.ips.local
pressy sshd Wed Mar 21 18:53 still logged in pressynb.ips.local
root pts/2 Wed Mar 21 18:50 still logged in pressynb.ips.local
root sshd Wed Mar 21 18:50 - 18:53 (00:02) pressynb.ips.local
root pts/2 Wed Mar 21 17:51 - 17:52 (00:00) pressynb.ips.local
root sshd Wed Mar 21 17:51 - 17:52 (00:00) pressynb.ips.local
root pts/2 Wed Mar 21 17:40 - 17:40 (00:00) pressynb.ips.local
root sshd Wed Mar 21 17:40 - 17:40 (00:00) pressynb.ips.local
root pts/2 Wed Mar 21 16:36 - 17:07 (00:31) pressynb.ips.local
root sshd Wed Mar 21 16:36 - 17:07 (00:31) pressynb.ips.local
regards pressy