'\"macro stdmacro
.if n .pH g1.last @(#)last	40.7 of 10/10/89
.\" Copyright 1989 AT&T
.\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved.
.\"
.nr X
.if \nX=0 .ds x} last 1 "User Environment Utilities" "\&"
.if \nX=1 .ds x} last 1 "User Environment Utilities"
.if \nX=2 .ds x} last 1 "" "\&"
.if \nX=3 .ds x} last "" "" "\&"
.TH \*(x}
.SH NAME
\f4last\f1 \- indicate last user or terminal logins
.SH SYNOPSIS
\f4last\f1
[
\f4\-n\f2 number\f1
|
\f4\-\f2number\f1
] [
\f4\-f\f2 filename\f1
] [
.IR name \||\| tty
] .\|.\|.
.SH DESCRIPTION
The
\f4last\f1
command looks in the
\f4/var/adm/wtmp\f1,
file which records all logins and logouts,
for information about a user, a terminal or
any group of users and terminals.
Arguments specify names of users or
terminals of interest.
Names of terminals may be given fully or abbreviated.
For example
\f4last 10\f1
is the same as
\f4last term/10\f1.
If multiple arguments are given,
the information which applies
to any of the arguments is printed.
For example
\f4last root console\f1
lists all of root's sessions
as well as all sessions on the console terminal.
\f4last\f1
displays the sessions of the specified
users and terminals, most recent first,
indicating the times at which the session began,
the duration of the session,
and the terminal which the
session took place on.
If the session is still continuing or was cut
short by a reboot,
\f4last\f1
so indicates.
.P
The pseudo-user
\f4reboot\f1
logs in at reboots of the system, thus
.IP
\f4last reboot\f1
.P
will give an indication of mean time between reboot.
.P
\f4last\f1
with no arguments displays a record of all logins and logouts, in
reverse order.
.P
If
\f4last\f1
is interrupted, it indicates how far the search has progressed in
\f4/var/adm/wtmp\f1.
If interrupted with a quit signal (generated by a
.SM CTRL\s0-\e)
\f4last\f1
indicates how far the search has progressed so far,
and the search continues.
.P
The following options are available:
.TP 14
\f4\-n\f2 number\||\|\f4\-\f2number\f1
Limit the number of entries displayed to that specified by
.IR number .
These options are identical;
the 
\f4\-\f2number\f1
option is provided as a transition tool only and will
be removed in future releases.
.TP 14
\f4\-f\f2 filename\f1
Use
.I filename
as the name of the accounting file instead of
\f4/var/adm/wtmp\f1.
.SH FILES
.PD 0
.TP 20
\f4/var/adm/wtmp\f1
accounting file
.PD
.SH "SEE ALSO"
\f4utmp\fP(4)
in the \f2System Administrator's Reference Manual\f1.
