The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
logged out users roshni Post Here to Contact Site Administrators and Moderators 1 07-06-2007 03:02 AM
how many users logged trichyselva Shell Programming and Scripting 4 05-06-2006 02:17 AM
Users logged in through which NIC cburtgo IP Networking 5 04-28-2006 06:59 PM
All tcp/ip users are logged out Docboyeee IP Networking 2 03-13-2003 01:07 PM
Information about users who have logged. rooh UNIX for Dummies Questions & Answers 2 12-26-2001 06:42 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-19-2005
jyoung jyoung is offline
Registered User
  
 

Join Date: Nov 2001
Location: Flint, MI
Posts: 225
Finding last time users logged in

I would like to find out the last time all users have logged in or out. I tried the last command, but it could not find the wtmp file in /var/adm (I searched in othe directories also). This is an AIX rs6000 4.2.1 system. We are moving our applications from this system to an AIX 5.2 system and I would like to not have to create logins for users that are no longer using them. Thank you for any help you can give me.
  #2 (permalink)  
Old 04-19-2005
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Try the 'last' command. I am not sure about AIX, I have never worked on it, but it works fine on Sun and HP.
  #3 (permalink)  
Old 04-20-2005
jyoung jyoung is offline
Registered User
  
 

Join Date: Nov 2001
Location: Flint, MI
Posts: 225
I did try the "last" command, but it did not find the wtmp file in the /var/adm directory. Anyother suggestions?
  #4 (permalink)  
Old 04-20-2005
jyoung jyoung is offline
Registered User
  
 

Join Date: Nov 2001
Location: Flint, MI
Posts: 225
I found the command lsuser and did this to get a list of users and the last time logged in:
lsuser -a time_last_login ALL > users.txt

Which gives me this result:
username time_last_login=1046099951
username time_last_login=1074022275
username time_last_login=899997008
.
.
username time_last_login=1046099951
username time_last_login=1074022275
username time_last_login=899997008

Is it possible to get the last date logged in from the above?
  #5 (permalink)  
Old 04-20-2005
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,116
Quote:
Originally Posted by jyoung
I found the command lsuser and did this to get a list of users and the last time logged in:
lsuser -a time_last_login ALL > users.txt

Which gives me this result:
username time_last_login=1046099951
username time_last_login=1074022275
username time_last_login=899997008
.
.
username time_last_login=1046099951
username time_last_login=1074022275
username time_last_login=899997008

Is it possible to get the last date logged in from the above?
when you say 'get the last date' what do you exatcly mean?
the 'date' is already there preceeded by '=' - you should be easily be able to use sed/awk to get the value.
  #6 (permalink)  
Old 04-20-2005
jyoung jyoung is offline
Registered User
  
 

Join Date: Nov 2001
Location: Flint, MI
Posts: 225
That is what I am looking for either sed, awk or any other type of code to get the value.
  #7 (permalink)  
Old 04-20-2005
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,116
Quote:
Originally Posted by jyoung
That is what I am looking for either sed, awk or any other type of code to get the value.
Code:
echo 'username time_last_login=1046099951' | sed 's/.*=\(.*\)$/\1/'
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 01:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0