LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   User Login/Logout with "Last" command (https://www.linuxquestions.org/questions/linux-security-4/user-login-logout-with-last-command-4175581201/)

ssslackw 06-01-2016 11:29 AM

User Login/Logout with "Last" command
 
Hi,
I need to find out when the user login and out from his account with "last user" command:

User pts/2 :0.0 Tue May 31 13:49 - 14:31 (00:41)
User pts/1 :0 Tue May 31 13:49 - 15:59 (02:09)
User :0 Tue May 31 13:49 - 14:31 (00:41)
User :0 Tue May 31 13:49 - 13:49 (00:00)
User pts/2 :0.0 Tue May 31 11:55 - 12:25 (00:30)
User pts/1 :0 Tue May 31 11:55 - 13:49 (01:54)
User :0 Tue May 31 11:55 - 12:25 (00:30)

Can someone tell me exactly when did the user login and out?

Thanks for your help in advance.

rtmistler 06-01-2016 11:51 AM

How about just issuing "last" by itself. I believe that shows exactly the information which you are seeking.

jayjwa 06-23-2016 04:42 PM

"last -w -F $USER" might be more readable. The output is user, tty logged in on, start time, end time, and total time logged in.


All times are GMT -5. The time now is 03:01 PM.