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.
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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.