martin carpenter

contents

most popular
2012/05/05, updated 2012/12/15
ubuntu unity lens for vim
2010/04/14
ckwtmpx

lastlog

2009/12/17

tags: solaris last(1)

github home http://github.com/mcarpenter/lastlog
repository URLs https://github.com/mcarpenter/lastlog.git
git://github.com/mcarpenter/lastlog.git

You might need this program if you want to check last time of local login and cannot check (or believe) wtmpx(4). The Solaris login facility records just the last login for each user in this file. Records are of fixed length and are indexed by UID (so root, with UID 0, is the first record). The file is grown as required, and null records are inserted for intermediate UIDs that have never logged in. The README follows:

lastlog

lastlog is a small program to display the contents of Solaris'
/var/adm/lastlog. This is a binary file that gets updated upon each
user login.

Although similar information can be extracted from wtmpx(4) (using
last(1)), reading the lastlog may be simpler or quicker if wtmpx(4)
grows quickly or is aggressively rolled.

The lastlog should not be confused with lastlogin(1M) from the
Solaris accounting facility.

Usage:

  lastlog

Sample output:

  0      root      Mon Oct 12 11:50:21 2009  pts/10   saturn
  10001  felipe    Wed Sep 17 14:15:02 2008  pts/8    122.106.27.6
  10013  boris     Mon Sep 21 12:23:54 2009  pts/18   jupiter


To build:

    make