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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Can I get a list of users that have not loged in past 6 months

Status
Not open for further replies.

Genka

MIS
Jul 15, 2001
20
0
0
US
I need to get a list of users that have not loged in more then 6 months ago, I though that maybe I can check the .profile of all the users, since .profile changes its date when a user logs in.

 
Hi Genka,

You could also look at a script based solution around the output of finger -l, so run through the /etc/passwd file to get all of the logins on the system and feed that through finger -l, and check out the 'last login' comment in the output.

It should be fairly simple to script this up and work out how long it is since the last login of each user login found and from that produce a list of users not logged in for 6 months or more.

Hope this helps.

Regards

Chris
 
The last command will do what your asking. You might need to search throught the output, but it displays the username, login port, host they came from, and date/time stamp.

# last | more

crowe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top