[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.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Last login all user details with last login date needed
HI Techies,
I need the details of last login of all user with the last login date. (of all user, not only for those who have log in)
I have system with HP-UX OS installed.
(HP-UX B.11.00 U 9000/800 646319351 unlimited-user license)
I tried with the "last" command but not getting all user last login details with date.
command gives me only details about last login users and time, month,date not the year details.
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:
/usr/sbin/acct/fwtmp </var/adm/wtmp
You can redirect that to a file:
e.g.
/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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.