Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Never logged in 1

Status
Not open for further replies.

bcme10

MIS
Jun 21, 2002
44
US
Anyone know the quickest way to get a listing of users who have never logged in?
 
The command [tt]finger[/tt] will say if a user has never logged on. I believe it gets that info from the file [tt]/var/adm/lastlog[/tt]. You could maybe write a little script to loop through the usernames and finger them individually, then grep the finger output for "Never logged in". Maybe something like...
Code:
#!/bin/ksh

listusers|awk '{print $1}'|while read USER
do
        CHECK="$(finger ${USER}|grep Never|uniq)"
        if [[ "${CHECK}" != "" ]]
        then
                print "${USER} has ${CHECK}"
        fi
done
There might be an easier way, but this seems to work.

Hope this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top