Finding last time users logged in


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Finding last time users logged in
# 8  
Old 04-20-2005
Thank you vgersh99 for your response. I guess I did not explain what I want very well and it is probably because I am a dummy when if comes to this stuff. Smilie What I would like if possible is to turn that value - 1046099951 in to a date such as 20050420 . I don't know if it is possible, but thought I would ask. I have a file - users.txt that has a line for each user with their id and last time logged in. If possible I would like to have a script that will convert the value on each line. Thank you for your help so far.
# 9  
Old 04-20-2005
not sure about AIX, but under Solaris one can convert epoch time to human-readable format like so:
Code:
   echo '0t1046099951=Y' | /usr/bin/adb

Others may have other ideas for AIX.
# 10  
Old 04-20-2005
Ok I will try that. I might also try a perl script that will read each line in the file I created and then convert the value to a date. If anyone else has ideas please let me know. Thank you.
# 11  
Old 04-20-2005
Here is a trick I picked up from Ygor:

Code:
#! /usr/bin/ksh

raw=1046099951
TIMESTAMP=$(perl -e '($ss, $mm, $hh, $DD, $MM, $YY) = localtime('$raw');
          printf "%04d%02d%02d%02d%02d", $YY + 1900 , $MM +1 , $DD, $hh, $mm')

echo $TIMESTAMP
exit 0

# 12  
Old 04-20-2005
Thank you Perderabo I will incorporate that into a perl script. That was along the lines of what I was thinking of doing. I was rummaging around for a script when I checked back here. Thank you for everyones help. As usual this forum is very good at providing good examples. Of course it helps when I explain my problem better.
 
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