Finding last time users logged in


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Finding last time users logged in
# 1  
Old 04-19-2005
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  
Old 04-19-2005
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  
Old 04-20-2005
I did try the "last" command, but it did not find the wtmp file in the /var/adm directory. Anyother suggestions?
# 4  
Old 04-20-2005
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  
Old 04-20-2005
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  
Old 04-20-2005
That is what I am looking for either sed, awk or any other type of code to get the value.
# 7  
Old 04-20-2005
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/'

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Sort current logged in users by log in time (supposedly to be very easy but I'm missing something)

1. The problem statement, all variables and given/known data: Show all users who are currently logged in, sorted from earliest to latest log in time. The log in time includes the month, day, and time. 2. Relevant commands, code, scripts, algorithms: finger, who, sort, pipe, head, tail, ... (8 Replies)
Discussion started by: vtmd
8 Replies

2. Shell Programming and Scripting

Finding out users logged in between 10:00AM and 11:00AM

Hi All, I have a specific requirement wherein I want a list of users who have logged in between 10:00 AM and 11:30 AM. Thanks, vini (4 Replies)
Discussion started by: vini kumar
4 Replies

3. Red Hat

Current logged in users

I have 2 systems. (1) RHEL5 and (2) winXP pro from xpPRO putty i ssh into rhel5 : user root from xpPRO i ftp into rhel5 : user abc123 when i run #uptime it only shows 1 user when i do #ps -u abc123 : it shows vsftpd deamon PID is there a command that can be used to show all currently... (4 Replies)
Discussion started by: dplinux
4 Replies

4. UNIX for Dummies Questions & Answers

How many users are logged in?

How do I find this out? I have a feeling its a simple command such as who, but I just don't know what it is. I've had a search on here but either I can't put it into the right search criteria or there isn't a topic on it. Thanks. EDIT: Delete this thread, as I posted it I noticed the... (0 Replies)
Discussion started by: chris_rabz
0 Replies

5. UNIX for Dummies Questions & Answers

Finding users logged on time and space useage

I need to find what users are currently logged onto the system that is easy just a simple who | awk '{ print $1 }' (thats all I need for the part), but I also need to find how long they have been logged on and the total amount of file space they are using. Thanks in advance, I have been looking... (3 Replies)
Discussion started by: mauler123
3 Replies

6. Shell Programming and Scripting

Users Not Logged in

I have searched the forums but have not mangaed to quite find what im looking for. I have used to /etc/passwd command to present me a list of all users the who command to present all users currently logged on, but what i want to know is what command can i use to display users that are registered... (12 Replies)
Discussion started by: warlock129
12 Replies

7. UNIX for Dummies Questions & Answers

How to do a login time and date list of users never logged on?

Hello, I'm trying to do a list of user that never connected to a couple of servers. I want to do a diff between the servers lists, and print out only the users that never has logged on each server. Here my first step : SERVER01: # finger `egrep -v -e "^\s*#" /etc/passwd | awk '{ print $1 }' |... (4 Replies)
Discussion started by: gogol_bordello
4 Replies

8. Post Here to Contact Site Administrators and Moderators

logged out users

how to find out users who logged out within 5 minutes (1 Reply)
Discussion started by: roshni
1 Replies

9. UNIX for Advanced & Expert Users

HP-UX users get logged off while idle.

Im "supporting" at least 2500 HP-UX workstations with CAD-related software with the B.11.11 build. I cant say anymore than that because of my companys sligtly paranoid security policy . The last few days a new problem has arised from nowhere. The problem is that users gets logged off when the... (5 Replies)
Discussion started by: Laoinjo
5 Replies

10. Shell Programming and Scripting

how many users logged

in unix what is the syntax to find out how many users are currently logged in (4 Replies)
Discussion started by: trichyselva
4 Replies
Login or Register to Ask a Question