blob: 314e5d9dcd0861a59acc5e6af245252a5744cd7f [file] [log] [blame]
.TH LAST 1 "20 March 1992"
.SH NAME
last \(em indicate last logins by user or terminal
.SH SYNOPSIS
.ad l
.B last
.RB [ \-\fP\fInumber\fP ]
.RB [ \-f
.IR filename ]
.RB [ \-t
.IR tty ]
.RB [ \-h
.IR hostname ]
.RB [ \-i
.IR address ]
.RB [ \-l ]
.RB [ \-y ]
.RI [ name ...]
.ad b
.SH DESCRIPTION
\fBLast\fP looks back in the \fBwtmp\fP file which records all logins
and logouts for information about a user, a teletype or any group of
users and teletypes. Arguments specify names of users or teletypes of
interest. If multiple arguments are given, the information which
applies to any of the arguments is printed. For example ``\fBlast root
console\fP'' would list all of root's sessions as well as all sessions
on the console terminal. \fBLast\fP displays the sessions of the
specified users and teletypes, most recent first, indicating the times
at which the session began, the duration of the session, and the
teletype which the session took place on. If the session is still
continuing or was cut short by a reboot, \fBlast\fP so indicates.
.LP
The pseudo-user \fBreboot\fP logs in at reboots of the system.
.LP
\fBLast\fP with no arguments displays a record of all logins and
logouts, in reverse order.
.LP
If \fBlast\fP is interrupted, it indicates how far the search has
progressed in \fBwtmp\fP. If interrupted with a quit signal \fBlast\fP
indicates how far the search has progressed so far, and the search
continues.
.SH OPTIONS
.IP \fB\-\fP\fInumber\fP
limit the number of entries displayed to that specified by \fInumber\fP.
.IP "\fB\-f\fP \fIfilename\fP"
Use \fIfilename\fP as the name of the accounting file instead of
.BR /var/log/wtmp .
.IP "\fB\-h\fP \fIhostname\fP"
List only logins from \fIhostname\fP.
.IP "\fB\-i\fP \fIIP address\fP"
List only logins from \fIIP address\fP.
.IP "\fB\-l\fP"
List IP addresses of remote hosts instead of truncated host names.
.IP "\fB\-t\fP \fItty\fP"
List only logins on \fItty\fP.
.IP "\fB\-y\fP"
Also report year of dates.
.SH FILES
/var/log/wtmp \(em login data base
.SH AVAILABILITY
The last command is part of the util-linux-ng package and is available from
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.