1.\" $NetBSD: lastlogin.8,v 1.12 2009/04/08 14:20:38 joerg Exp $ 2.\" 3.\" Copyright (c) 1996 John M. Vinopal 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed for the NetBSD Project 17.\" by John M. Vinopal. 18.\" 4. The name of the author may not be used to endorse or promote products 19.\" derived from this software without specific prior written permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 23.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 25.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" SUCH DAMAGE. 32.\" 33.Dd March 4, 2005 34.Dt LASTLOGIN 8 35.Os 36.Sh NAME 37.Nm lastlogin 38.Nd indicate last login time of users 39.Sh SYNOPSIS 40.Nm 41.Op Fl nrt 42.Op Fl f Ar filename 43.Op Fl H Ar hostsize 44.Op Fl L Ar linesize 45.Op Fl N Ar namesize 46.Op user ... 47.Sh DESCRIPTION 48.Nm 49will list the last login session of specified 50.Ar users , 51or for all users by default. Each line of output contains 52the user name, the tty from which the session was conducted, any 53hostname, and the start time for the session. 54.Pp 55If multiple 56.Ar users 57are given, the session information for each user is printed in 58the order given on the command line. Otherwise, information 59for all users is printed, sorted by uid. 60.Pp 61.Nm 62differs from 63.Xr last 1 64in that it only prints information regarding the very last login session. 65The last login database is never turned over or deleted in standard usage. 66.Pp 67The following options are available: 68.Bl -tag -width indent 69.It Fl f Ar filename 70Process input from 71.Ar filename . 72If the file ends with an 73.Dq x , 74then it is assumed that it is a 75.Xr lastlogx 5 76file, else it is assumed to be a 77.Xr lastlog 5 78file. 79.It Fl H Ar hostlen 80Set the field width for host output to 81.Ar hostlen 82characters. 83.It Fl L Ar linelen 84Set the field width for line output to 85.Ar linelen 86characters. 87.It Fl N Ar namelen 88Set the field width for name output to 89.Ar namelen 90characters. 91.It Fl n 92Attempt to print numeric host addresses. 93This option is only supported with 94.Xr lastlogx 5 95format files. 96.It Fl r 97Reverse the order of the sort. 98.It Fl t 99Sort by last login time (most recent first.) 100.El 101.Sh FILES 102.Bl -tag -width /var/log/lastlogx -compact 103.It Pa /var/log/lastlogx 104default last login database 105.It Pa /var/log/lastlog 106compatibility last login database 107.El 108.Sh EXAMPLES 109.Nm 110looks by default to the 111.Pa /var/log/lastlogx 112database, where some old programs that are not 113.Xr utmpx 5 114aware might only write to 115.Pa /var/log/lastlog . 116To look at the old database one can use: 117.Pp 118.Dl lastlogin -f /var/log/lastlog 119.Sh SEE ALSO 120.Xr last 1 , 121.Xr lastlog 5 , 122.Xr lastlogx 5 , 123.Xr ac 8 124.Sh AUTHORS 125.An John M. Vinopal 126wrote this program in January 1996 and contributed it to the 127.Nx 128project. 129