LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-28-2012, 09:23 AM   #1
newbie0101
Member
 
Registered: Nov 2011
Posts: 47

Rep: Reputation: Disabled
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
 
Old 01-29-2012, 02:08 AM   #2
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
This: http://pwet.fr/man/linux/commandes/radlist

Regards
 
Old 01-29-2012, 10:31 AM   #3
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 13.1
Posts: 1,330

Rep: Reputation: 254Reputation: 254Reputation: 254
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Inactive Account Lock pattanaikhr Linux - Software 3 04-21-2011 03:57 AM
account should be expired/locked if not logged in for 15 days through FTP linux_beginer Linux - Server 1 03-26-2011 07:25 AM
account should be expired if not logged in for 15 days through FTP linux_beginer Linux - Server 5 03-24-2011 12:36 AM
to lock the account if not accessed through FTP for 15 days linux_beginer Linux - Newbie 2 03-23-2011 10:46 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration