blob: 17e926048f5e6df8c4bd447bddd9238eea048749 [file] [log] [blame] [view] [raw]
.\"{{{}}}
.\"{{{ Title
.TH LAST,LASTB 1 "Jul 31, 2004" "" "Linux System Administrator's Manual"
.\"}}}
.\"{{{ Name
.SH NAME
last, lastb \- show listing of last logged in users
.\"}}}
.\"{{{ Synopsis
.SH SYNOPSIS
.B last
.RB [ \-R ]
.RB [ \-\fInum\fP ]
.RB "[ \-\fBn\fP \fInum\fP ]"
.RB [ \-adFiox ]
.RB "[ \-\fBf\fP \fIfile\fP ]"
.RB "[ \-\fBt\fP \fIYYYYMMDDHHMMSS\fP ]"
.RI [ name... ]
.RI [ tty... ]
.br
.B lastb
.RB [ \-R ]
.RB [ \-\fInum\fP ]
.RB "[ \-\fBn\fP \fInum\fP ]"
.RB "[ \-\fBf\fP \fIfile\fP ]"
.RB [ \-adFiox ]
.RI [ name... ]
.RI [ tty... ]
.\"}}}
.\"{{{ Description
.SH DESCRIPTION
.B Last
searches back through the file \fB/var/log/wtmp\fP (or the file
designated by the \fB\-f\fP flag) and displays a list of all
users logged in (and out) since that file was created. Names of users
and tty's can be given, in which case \fBlast\fP will show only those entries
matching the arguments. Names of ttys can be abbreviated, thus \fBlast
0\fP is the same as \fBlast tty0\fP.
.PP
When \fBlast\fP catches a \s-2SIGINT\s0 signal (generated by the interrupt key,
usually control-C) or a \s-2SIGQUIT\s0 signal (generated by the quit key,
usually control-\e), \fBlast\fP will show how far it has searched through the
file; in the case of the \s-2SIGINT\s0 signal \fBlast\fP will then terminate.
.PP
The pseudo user \fBreboot\fP logs in each time the system is rebooted.
Thus \fBlast reboot\fP will show a log of all reboots since the log file
was created.
.PP
\fBLastb\fP is the same as \fBlast\fP, except that by default it shows a log
of the file \fB/var/log/btmp\fP, which contains all the bad login attempts.
.\"}}}
.\"{{{ Options
.SH OPTIONS
.IP "\fB\-f\fP \fIfile\fP"
Tells \fBlast\fP to use a specific file instead of \fB/var/log/wtmp\fP.
.IP \fB\-\fP\fInum\fP
This is a count telling \fBlast\fP how many lines to show.
.IP "\fB\-n\fP \fInum\fP"
The same.
.IP "\fB\-t\fP \fIYYYYMMDDHHMMSS\fP"
Display the state of logins as of the specified time. This is
useful, e.g., to determine easily who was logged in at a particular
time -- specify that time with \fB\-t\fP and look for "still logged
in".
.IP \fB\-R\fP
Suppresses the display of the hostname field.
.IP \fB\-a\fP
Display the hostname in the last column. Useful in combination
with the next flag.
.IP \fB\-d\fP
For non-local logins, Linux stores not only the host name of the remote
host but its IP number as well. This option translates the IP number
back into a hostname.
.IP \fB\-F\fP
Print full login and logout times and dates.
.IP \fB\-i\fP
This option is like \fB-d\fP in that it displays the IP number of the remote
host, but it displays the IP number in numbers-and-dots notation.
.IP \fB\-o\fP
Read an old-type wtmp file (written by linux-libc5 applications).
.IP \fB\-x\fP
Display the system shutdown entries and run level changes.
.\"}}}
.SH NOTES
The files \fIwtmp\fP and \fIbtmp\fP might not be found. The system only
logs information in these files if they are present. This is a local
configuration issue. If you want the files to be used, they can be
created with a simple \fBtouch\fP(1) command (for example,
\fItouch /var/log/wtmp\fP).
.\"{{{ Files
.SH FILES
/var/log/wtmp
.br
/var/log/btmp
.\"}}}
.\"{{{ Author
.SH AUTHOR
Miquel van Smoorenburg, miquels@cistron.nl
.\"}}}
.\"{{{ See also
.SH "SEE ALSO"
.BR shutdown (8),
.BR login (1),
.BR init (8)
.\"}}}