This is a discussion on Find users logged on more than once within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hi ! How can I get the list of users who are logged on more than once ? Can ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi ! How can I get the list of users who are logged on more than once ? Can someone help me with this ? Thanks ! -- Pozdrav Revenger 14.6.2006 09:55:51 Jednom su proizveli Chuck Norris toalet papir, ali papir nije dopustao da itko sere po njemu. |
| |||
| Revenger wrote: > Hi ! > How can I get the list of users who are logged on more than once ? > Can someone help me with this ? > Thanks ! > -- > Pozdrav > Revenger > 14.6.2006 09:55:51 > Jednom su proizveli Chuck Norris toalet papir, ali papir nije dopustao da > itko sere po njemu. You might check the /var/adm/wtmp file or the output of "last" command to see if they could help. Your question is not specific to AIX system, so I guess if you post the question in comp.unix.shell or comp.unix.admin, you might get responses in quick succession. James |
| ||||
| Revenger wrote: > Hi ! > How can I get the list of users who are logged on more than once ? > Can someone help me with this ? > Thanks ! > -- > Pozdrav This is probably not the ideal way to do it if you have a lot of users on the system, as you have to grep a file once for EVERY user entry, but it works. It shows a list of any duplicate user logins at the time of the sampling. I think this could be done using awk in a better way, but didnt have time to sit down and figure it out. # START OF SCRIPT #!/bin/ksh #set -vx /bin/rm /tmp/user.snapshot 2>/dev/null TIMESTAMP="$(date +"%c")" who|sort|sed -e "s/ /!/g">/tmp/user.snapshot TITLEBAR=Y for LOOP in $(cat /tmp/user.snapshot) do USRNAM=$(echo "${LOOP}"|cut -c1-8) if test $(cat /tmp/user.snapshot|grep "^${USRNAM}"|wc -l) -gt 1 then if test "${TITLEBAR}" = "Y" then TITLEBAR=N echo "\nList of Duplicate Users as of ${TIMESTAMP}:\n" fi echo "${LOOP}"|sed -e "s/!/ /g" fi done /bin/rm /tmp/user.snapshot # END OF SCRIPT |