[SOLVED] Last login all user details with last login date needed
Other *NIXThis forum is for the discussion of any UNIX platform that does not have its own forum. Examples would include HP-UX, IRIX, Darwin, Tru64 and OS X.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Interesting - I installed some HP-UX 11 systems in Vashi (Navi Mumbai) back in 1998. I wonder if you're using those.
Anyway the information is stored in /var/adm/wtmp as binary data. Since /var/adm/wtmp grows it isn't unusual for people to truncate it over time to free up space so it may not have all the history you want.
You can use fwtmp command to dump wtmp file into ASCII format and see the year for logins there. You'd have to script getting the last login for each user.
The dump can be done with:
You can redirect that to a file:
/usr/sbin/acct/fwtmp </var/adm/wtmp >/var/adm/crash/fwtmp.out
Note that /var/adm/wtmp is often very large so it is important that you be sure your target directory/filesystem has enough room for the ascii dump.
Last edited by MensaWater; 06-08-2011 at 01:17 PM.
Hye Mensa Water thanks for your reply,
Am not working at Vashi working with some ware else.
I check with your advice but I did not find the required information, as I need all users last login details, not only those who had logged in to the system. I check the wtmp.
wtmp gives me only those details who have at least logged in to the system at single time.
Any way’s nice for R & D
I found one script from Google which derived the details using last command and with the help of passwd file. but still I am facing one issue as the last command not giving me year details the last command gives me only time month and users details.
So please advise me if any command is there with providing user login details with year information.