LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   check how many days has been an account inactive (https://www.linuxquestions.org/questions/programming-9/check-how-many-days-has-been-an-account-inactive-926168/)

newbie0101 01-28-2012 09:23 AM

check how many days has been an account inactive
 
hi, how can one check for how many days an user hasn't logged into they account ?

i know there is command:
Code:

last user
that tells me when was last logged in but i want to have number of days that the user hasn't logged in.

thanks

ukiuki 01-29-2012 02:08 AM

This: http://pwet.fr/man/linux/commandes/radlist

Regards

Reuti 01-29-2012 10:31 AM

last will only work on the latest wtmp file, which might have been rotated already and for former entries you would have to scan in the rotated ones.

You can use:
Code:

$ lastlog -u user
which will give you the latest time the user was logged in. The difference in days needs to be computed though.


All times are GMT -5. The time now is 08:10 PM.