Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-27-2009, 11:57 AM   #1
Registered: Jun 2008
Posts: 405

Rep: Reputation: 31
Can I find out when and for how long a user was logged on?

I thought there might be a log somewhere, but I can't find one so far.

I want to know when a certain user has logged in recently and for how long they stayed logged. I suppose I might be able to dig through the messages log and piece something together if necessary.

Are there any easier options?
Old 02-27-2009, 11:59 AM   #2
Senior Member
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,225

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
the command would be 'last'
open a terminal and at the promt type last

the output looks like such
root     pts/0        :0.0             Fri Feb 27 12:06   still logged in   
root     pts/0        :0.1             Fri Feb 27 11:16 - 11:17  (00:01)    
root     pts/1        :0.0             Fri Feb 27 11:16 - 11:17  (00:00)    
root     :0                            Fri Feb 27 11:15   still logged in   
reboot   system boot Fri Feb 27 11:15          (00:51)    
root     pts/0        :0.0             Thu Feb 26 23:56 - down   (10:47)    
root     pts/1        :0.1             Thu Feb 26 23:56 - down   (10:47)    
root     :0                            Thu Feb 26 23:56 - down   (10:47)    
root     pts/1        :0.1             Thu Feb 26 22:18 - 23:56  (01:38)    
root     pts/0        :0.0             Thu Feb 26 19:36 - 23:56  (04:19)    
root     :0                            Thu Feb 26 19:10 - 23:56  (04:45)
p.s. don't follow my stupidity and use root like a normal account
*shame shame to myself :P*
if you want a specific user the command is last *user*
where *user* is the username you wanna look at

Last edited by frieza; 02-27-2009 at 12:02 PM.
Old 02-27-2009, 12:28 PM   #3
Registered: Jun 2008
Posts: 405

Original Poster
Rep: Reputation: 31
Ah, the last command, excellent. This exactly what I needed.


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
How to find out where else I'm logged in x42bn6 Linux - Newbie 2 04-17-2008 09:06 PM
Gnome: Auto mounting external devices as first user logged in, not current user yitzle Linux - Software 4 04-01-2008 09:43 AM
how to find who logged in a month mokku Linux - Newbie 2 02-19-2008 01:57 PM
Multi-user and 3D sharing, 3D only works for the first logged in user foxy123 SUSE / openSUSE 0 02-20-2005 04:31 AM
mozilla works fine when logged in as a user but crashes when logged in as root jimi Linux - General 6 04-02-2003 08:34 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:42 AM.

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