Displaying the year with the last command

The complete timestamp of user logins and logouts is stored in /var/adm/wtmpx, but the last command, at least on the Solaris 9 system in this example, does not display the year in its output.

The easiest way to display the year from wtmpx data is to compile and execute utxreader. You may download a compiled version that works on Solaris 8, 9, and 10.

Example:

$ last test_user
test_user   pts/2        192.168.33.7     Fri Jan 27 11:31 - 11:31  (00:00)

$ ./utxreader /var/adm/wtmpx | grep test_user
user=test_user:fmttime=20060127-113109:host=192.168.33.7:init_id=ts/2pts/2:device=pts/2:pid=11940:proc_type=7:term_status=0:exit_status=0:
user=test_user:fmttime=20060127-113143:host=:init_id=ts/2pts/2:device=pts/2:pid=11940:proc_type=8:term_status=0:exit_status=0:

More information:
ITworld.com - Looking for last logins

Back to brandonhutchinson.com.
Last modified: 2007/10/19