Operating System - Tru64 Unix
cancel
Showing results for 
Search instead for 
Did you mean: 

sorting users

SOLVED
Go to solution
Rupert_1
Advisor

sorting users

what is the command ( scripts) to sort users
who have not logging for more than 6 months.
Tru64 Unix 5.1A.
2 REPLIES
Michael Schulte zur Sur
Honored Contributor
Solution

Re: sorting users

Hi,

find / -name .profile -atime +180 -print

Michael

Re: sorting users

Here's another solution that isn't shell dependant but requires the use of C2 security.

It pulls the username out of the prpasswd database for users that have last logged in more that 6 months ago. You need to feed it the date 6 months ago in unix time (# of seconds since epoch).

/tcb/bin/edauth -g |./prpasswd.sed |awk -F: '{ for ( i=1; i<=NF ; i++ ){ if ( $i ~ /^u_succhg#/ ) { split($i,x,"#") ; if ( x[2] < 1060965450 ) print $1 }}}'

I use the prpasswd.sed script to fix an old bug in NIS where the "\" in edauth output mucks up the creation of btree files. The script strips those characters out.