Reporting last login details


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Reporting last login details
# 1  
Old 12-08-2016
Reporting last login details

Most of my Solaris 10 user accounts are generally 10 characters long. When I run the 'last' command the report only shows the first 8 characters so the information is not very helpful. How can I report the full 10 character user account.
# 2  
Old 12-08-2016
The last command is kind of a sore spot for me. I believe the date works the way the ls command handles dates - when displaying a record, after six months of age for the record, the year shows up.

This works to get a full date. The big number you see is the UNIX time (seconds since Jan 1970).

Code:
cat /var/adm/wtmpx | /usr/lib/acct/fwtmp | tac  > tmpfile
awk  '!arr[$1]++ {print $1 $2}'  tmpfile

-note the cat is intended fwtmp only reads from stdin. Since this is messy I would consider simply living with the knowledge of how dates are displayed.

You are going to have extra fields, so the awk needs some changing to suit your needs. i.e., change the awk print statement to show what you want
This User Gave Thanks to jim mcnamara For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Changing login details

Dear Administrators! I would like to change my username for this forum, would it be possible? Regards FR (1 Reply)
Discussion started by: fretagi
1 Replies

2. Shell Programming and Scripting

passing login details to htaccess login prompt

Hi, How i can pass the login details to the URL which is password protected with the htaccess using command line or script (perl,or shell,or php). Any help or hint appreciated. Thanks, SJ (4 Replies)
Discussion started by: SilvesterJ
4 Replies

3. UNIX for Dummies Questions & Answers

Capturing the login logout details of user

Hi I'm new to Shell scripting .Can anyone please help me how to capture user's login and logout details and load them into a table... we are using Oracle DB on UNIX:confused: (3 Replies)
Discussion started by: rajmohan146
3 Replies

4. UNIX for Dummies Questions & Answers

at -l doesnt give details of the scheduled job. How to get the details?

I have scheduled couple of shell scripts to run using 'at' command. The o/p of at -l is: $ at -l 1320904800.a Thu Nov 10 01:00:00 2011 1320894000.a Wed Nov 9 22:00:00 2011 1320876000.a Wed Nov 9 17:00:00 2011 $ uname -a SunOS dc2prcrptetl2 5.9 Generic_122300-54 sun4u sparc... (2 Replies)
Discussion started by: superparticle
2 Replies

5. AIX

How to find the year in last login details

Hi Friends I have a query. we had a requirement to see the last login details of our users so I ran the command last <username> and the output i get is: wtmp begins Apr 17 21:48 Now I need to know couple of things: 1. How can I see the year this log is being read from wtmp file 2. Is... (4 Replies)
Discussion started by: nathandrake13
4 Replies

6. AIX

Last login details in banner

Friends!! I need your help. Where can i change/set the last login details as below in aix 5.3. And how to do that to get the results as exactly below login as: mbpops mbpops@xx.28.3.24's password: Last unsuccessful login: Mon Nov 22 14:32:27 GMT 2010 on ssh from 10.132.5.129 Last login:... (17 Replies)
Discussion started by: kmvinay
17 Replies

7. UNIX for Dummies Questions & Answers

Check login details

As a root user i switch to a different user say "oratest". I would like to know the details like at what time did the switch ( su - oratest ) happen. Are there any logs to check this Thanks. (4 Replies)
Discussion started by: jjoy
4 Replies

8. Post Here to Contact Site Administrators and Moderators

Reg:Login details

Hi, I want to change my login name.Can u please suggest me how to do that.:confused: Regards, Jyothi (3 Replies)
Discussion started by: jyothi_wipro
3 Replies

9. UNIX for Dummies Questions & Answers

IP details for Unix/Linux login clients?

Hi there, I am wondering if by logging in to a unix system, if it is possible to get the IP address of the machine I am connecting FROM. I know how I can do this using the name server, but is this possible without a host lookup?:confused: Thanks, -ghoti (15 Replies)
Discussion started by: ghoti
15 Replies

10. UNIX for Dummies Questions & Answers

Reporting

I have to do a lot of reporting for the company that I work for and was wondering if anyone had suggestions for a way to create professional looking reports. I currently use Filepro so much that I rarely see the shell. Any help is appreciated. (3 Replies)
Discussion started by: Mike11
3 Replies
Login or Register to Ask a Question