Operating System - HP-UX
1827385 Members
4360 Online
109963 Solutions
New Discussion

How to find the last login time of a user

 
R.SRIDHAR
Occasional Advisor

How to find the last login time of a user

I want to find the last login time of a particular user....?
How to find it..
7 REPLIES 7
john123
Trusted Contributor

Re: How to find the last login time of a user

Hi Sridhar.,

Use finger username or
last|grep username|head -n1

John
Yogeeraj_1
Honored Contributor

Re: How to find the last login time of a user

hi,

try:

last|grep | head -1

e.g.
SRV2:>last ora10g|head -1
ora10g ftp Sun Aug 26 08:49 - 08:49 (00:00)
SRV2:>

hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Sp4admin
Trusted Contributor

Re: How to find the last login time of a user

Hello,

You can use the "last" command or the "lastb" command to see who has logged in. Try a man on last for more details.

sp,
Tim Nelson
Honored Contributor

Re: How to find the last login time of a user

/usr/lbin/getprpw -m slogint username

works for trusted systems.


Patrick Wallek
Honored Contributor

Re: How to find the last login time of a user

Why would you use "last|grep "? The last command can take a user name as input.

# last user

Will show logins for 'user'.
Bill Hassell
Honored Contributor

Re: How to find the last login time of a user

The man page is helpful. As Patrick points out, you can limit the last output to a single user. But wait, there's more. Try this:

last -R -10 user_name

This reports only user_name logins (10 most recent) along with the hostname or IP address of the user_name.


Bill Hassell, sysadmin
whiteknight
Honored Contributor

Re: How to find the last login time of a user

hi,

you can use

# last -5


WK
Problem never ends, you must know how to fix it