User Login History
Posted:
Friday, March 15th, 2013Last modified:
Thursday, April 30th, 2015Get a list of all currently logged in users
who
Example
% who someuser pts/1 2013-03-15 20:38 (pool-00-000-90-237.foobar.fios.comcast.net)
Get a list of all currently logged in users and what they are doing
w -u
Example
% w -u 20:48:58 up 21 min, 1 user, load average: 0.01, 0.07, 0.15 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT someuser pts/1 pool-10-110-10-2 20:38 1.00s 0.06s 0.00s w -u
Get a list of all currently logged in users in a format suitable for looping over
users
% users foouser baruser bazuser
Get the last login info for all users
lastlog
Example
% lastlog Username Port From Latest bin **Never logged in** daemon **Never logged in** adm **Never logged in** lp **Never logged in** sync **Never logged in** [ ...snip... ] someuser pts/1 pool-00-000-90-2 Fri Mar 15 20:38:44 -0400 2013 otheruser pts/2 pool-00-000-73-1 Tue Jan 29 13:42:07 -0500 2013
Get last login info for a given user
lastlog -u USERLOGIN
Example
lastlog -u someuser Username Port From Latest someuser pts/1 pool-00-000-90-2 Fri Mar 15 20:38:44 -0400 2013
Available Wiki Topics
The operator of this site makes no claims, promises, or guarantees of the accuracy, completeness, originality, uniqueness, or even general adequacy of the contents herein and expressly disclaims liability for errors and omissions in the contents of this website.