LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-01-2016, 11:29 AM   #1
ssslackw
Member
 
Registered: Aug 2005
Posts: 61

Rep: Reputation: 2
Cool 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.
 
Old 06-01-2016, 11:51 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,879
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
How about just issuing "last" by itself. I believe that shows exactly the information which you are seeking.
 
Old 06-23-2016, 04:42 PM   #3
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 767

Rep: Reputation: 241Reputation: 241Reputation: 241
"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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't login to gnome session "Logout" atultiwari Linux - Desktop 3 03-18-2012 04:21 PM
[SOLVED] How do I run "menu" and "logout" from the command line in fluxbox? psionl0 Slackware 19 03-02-2011 12:46 AM
automatic mail of "Last User Login Logs" & "AIX Logs" nishith AIX 3 12-04-2009 12:42 PM
How do I disable "shutdown" and "restart" options in KDE logout screen for all users? maxgsp Linux - Distributions 1 12-12-2008 03:18 PM
User Login Problem: "command not found" unless root! DreameR-X Linux - General 15 12-21-2004 11:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration