Last login<urgent>


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Last login<urgent>
# 1  
Old 02-05-2008
Last login<urgent>

how to find last login time of a user in faster way if wtmps size is too large??
# 2  
Old 02-05-2008
Last login<urgent>

Last login<urgent>
how to find last login time of a user in faster way if wtmps size is too large??
# 3  
Old 02-05-2008
What wrong with last?

last <user> |head -1
# 4  
Old 02-05-2008
last login

thanks vbe...
but this command takes long time to give the output if we display a list of users with last login value when wtmp is huge..
any other solution???

thanks,
Vishwaraj
# 5  
Old 02-06-2008
Try with -n option it will be probably faster then getting all records
# 6  
Old 02-06-2008
>how to find last login time of a user in faster way if wtmps size is too large??
I though your question was the last login of A user, in such case my command to type should not take more than 4 seconds at the most or you have some trouble (the longest delay I got so far was 1.5!)
I did not say to type last, as this will display all the successfull attempt of all the users since the origin of wtmp, but last <your user name>| head -1 (the first line: the last login) or whatever lines you need or as suggested: last -1 <username> which would be faster still...

Here are some records:

ant:/var/spool/cron/crontabs $ timex last|wc -l

real 16.32
user 9.40
sys 1.55

182882
ant:/var/spool/cron/crontabs $ timex last vbe|head -1
vbe pts/1 Thu Jan 31 16:26 - 16:33 (00:06)


real 0.42
user 0.19
sys 0.08

ant:/var/spool/cron/crontabs $ timex last -1 vbe
vbe pts/1 Thu Jan 31 16:26 - 16:33 (00:06)

real 0.03
user 0.01
sys 0.01

With 182882 records it replies (almost) instantly...

No doubt last -1 name is the fatest...

I suggest that you resize wtmp at something reasonable if it is giving you trouble... ( save a copy before for archive history... since you can use last specifying a filename also! great no?)

If you have may users you want the information write a script that read the list of names

All the best
# 7  
Old 02-06-2008
thanks a lot vbe Smilie

got an idea...
i'l try it by writing a script for the names of all users...


thanks,
vishwaraj
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies

2. UNIX for Advanced & Expert Users

First login on KUbuntu 16.04 no SKEL copied with first login LDAPusers

Hello, we have an problem on kubuntu16.04 that when i login with ldap, and it is my first login, nothing is copied from skel. With SSH it is working fine. Can anyone say we how KDE setup an new first userlogin? Tested with SDDM and Lightdm. Thanks a lot! Best Regard darktux ----------... (1 Reply)
Discussion started by: darktux
1 Replies

3. Red Hat

Sshd_config file issue, not able to login, need urgent help.

Hello all, By mistake i edited sshd_config file and made passwordauthentication no , Now i don't have key to login. Is there any way, i can revert the changes, I am not able to login to the box at well. Need help. Thanks, saurau (3 Replies)
Discussion started by: saurau
3 Replies

4. UNIX for Advanced & Expert Users

Can adding to a new group be effective in current login environment without re-login?

Hey folks, When a user is added to a new group, the user has to be log out and log in again to make the new group effective. Is there any system command or technique to refresh user group ID update without re-login? I am not talking about to use "login" or "su -l" commands which can only make... (2 Replies)
Discussion started by: hce
2 Replies

5. Solaris

error message rmclomv ... SC Login Failure for user Please login:

Hello World ~ HW : SUN Fire V240 OS : Solaris 8 Error message prompts 'rmclomv ... SC login failure ...' on terminal. and Error Message prompts continually 'SC Login Failure for user Please login:' on Single Mode(init S) The System is in normal operation, though In case of rain, Can... (1 Reply)
Discussion started by: lifegeek
1 Replies

6. Cybersecurity

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both, when... (1 Reply)
Discussion started by: WhotheWhat
1 Replies

7. Web Development

APACHE: Tie in Web Page login with server login

Hello, I have created a web page on a server using apache and added .htaccess and .htpasswd in the folder for authentification. I was wondering if there was anyway to tie-in the login for this page with the login used to logon to the server. i.e. the same login info. is used for both,... (2 Replies)
Discussion started by: WhotheWhat
2 Replies

8. UNIX for Advanced & Expert Users

URGENT,URGENT- Need help tape drive installation

Hi, I am trying to attach tape drive to sun V890 running Solaris 9 on it. I have installed HBA(qlogic) in slot 1 of 0-8 slots and booted the system. I do not see HBAin prtdiag output. The tape drive is not attached to HBA. The tape drive I am going to attach is Sony AIT3. 1.How can I make... (3 Replies)
Discussion started by: sriny
3 Replies
Login or Register to Ask a Question