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.

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).

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

1 Like