how to get user login time
Hello, could someone tell me how to get each a user's login time on a linux system(meaning the time between his last login and the present or between his last login and the time when he left, if he's not logged currently). I've already tried finger and last but they only give me the date of the login or the interval.
|
Not sure, but auth.log should have the log-in and log-out times.
|
you can do:
last | grep username |
Quote:
Code:
***** pts/5 :pts/3:S.0 Wed Feb 4 06:09 - 06:30 (00:20) cheers, |
Oh, I see, I thought the info in round brackets after the login interval were minutes and seconds so i ignored it. Pretty stupid thing to do ,really. Thank you for the quick replies, that solves half of the problem. I stil notice that the users that are still logged on don't have the login duration up to the current time calculated. Isn't there a way to get that too?
|
All times are GMT -5. The time now is 08:37 PM. |