[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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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.