Include -Wunreachable-code when building.
[sysvinit.git] / man / last.1
CommitLineData
a74aeac6
PR
1'\" -*- coding: UTF-8 -*-
2.\" Copyright (C) 1998-2004 Miquel van Smoorenburg.
3.\"
4.\" This program is free software; you can redistribute it and/or modify
5.\" it under the terms of the GNU General Public License as published by
6.\" the Free Software Foundation; either version 2 of the License, or
7.\" (at your option) any later version.
8.\"
9.\" This program is distributed in the hope that it will be useful,
10.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12.\" GNU General Public License for more details.
13.\"
14.\" You should have received a copy of the GNU General Public License
15.\" along with this program; if not, write to the Free Software
16.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17.\"
18.\"{{{}}}
19.\"{{{ Title
20.TH LAST,LASTB 1 "Jul 31, 2004" "" "Linux System Administrator's Manual"
21.\"}}}
22.\"{{{ Name
23.SH NAME
24last, lastb \- show listing of last logged in users
25.\"}}}
26.\"{{{ Synopsis
27.SH SYNOPSIS
28.B last
29.RB [ \-R ]
30.RB [ \-\fInum\fP ]
31.RB "[ \-\fBn\fP \fInum\fP ]"
1414572e 32.RB [ \-adFiowx ]
a74aeac6
PR
33.RB "[ \-\fBf\fP \fIfile\fP ]"
34.RB "[ \-\fBt\fP \fIYYYYMMDDHHMMSS\fP ]"
35.RI [ name... ]
36.RI [ tty... ]
37.br
38.B lastb
39.RB [ \-R ]
40.RB [ \-\fInum\fP ]
41.RB "[ \-\fBn\fP \fInum\fP ]"
42.RB "[ \-\fBf\fP \fIfile\fP ]"
1414572e 43.RB [ \-adFiowx ]
a74aeac6
PR
44.RI [ name... ]
45.RI [ tty... ]
46.\"}}}
47.\"{{{ Description
48.SH DESCRIPTION
49.B Last
50searches back through the file \fB/var/log/wtmp\fP (or the file
51designated by the \fB\-f\fP flag) and displays a list of all
52users logged in (and out) since that file was created. Names of users
53and tty's can be given, in which case \fBlast\fP will show only those entries
54matching the arguments. Names of ttys can be abbreviated, thus \fBlast
550\fP is the same as \fBlast tty0\fP.
56.PP
57When \fBlast\fP catches a \s-2SIGINT\s0 signal (generated by the interrupt key,
58usually control-C) or a \s-2SIGQUIT\s0 signal (generated by the quit key,
59usually control-\e), \fBlast\fP will show how far it has searched through the
60file; in the case of the \s-2SIGINT\s0 signal \fBlast\fP will then terminate.
61.PP
62The pseudo user \fBreboot\fP logs in each time the system is rebooted.
63Thus \fBlast reboot\fP will show a log of all reboots since the log file
64was created.
65.PP
66\fBLastb\fP is the same as \fBlast\fP, except that by default it shows a log
67of the file \fB/var/log/btmp\fP, which contains all the bad login attempts.
68.\"}}}
69.\"{{{ Options
70.SH OPTIONS
71.IP "\fB\-f\fP \fIfile\fP"
72Tells \fBlast\fP to use a specific file instead of \fB/var/log/wtmp\fP.
73.IP \fB\-\fP\fInum\fP
74This is a count telling \fBlast\fP how many lines to show.
75.IP "\fB\-n\fP \fInum\fP"
76The same.
77.IP "\fB\-t\fP \fIYYYYMMDDHHMMSS\fP"
78Display the state of logins as of the specified time. This is
79useful, e.g., to determine easily who was logged in at a particular
80time -- specify that time with \fB\-t\fP and look for "still logged
81in".
82.IP \fB\-R\fP
83Suppresses the display of the hostname field.
84.IP \fB\-a\fP
85Display the hostname in the last column. Useful in combination
86with the next flag.
87.IP \fB\-d\fP
88For non-local logins, Linux stores not only the host name of the remote
89host but its IP number as well. This option translates the IP number
90back into a hostname.
91.IP \fB\-F\fP
92Print full login and logout times and dates.
93.IP \fB\-i\fP
94This option is like \fB-d\fP in that it displays the IP number of the remote
95host, but it displays the IP number in numbers-and-dots notation.
96.IP \fB\-o\fP
97Read an old-type wtmp file (written by linux-libc5 applications).
1414572e
DWF
98.IP \fB\-w\fP
99Display full user and domain names in the output.
a74aeac6
PR
100.IP \fB\-x\fP
101Display the system shutdown entries and run level changes.
102.\"}}}
103.SH NOTES
104The files \fIwtmp\fP and \fIbtmp\fP might not be found. The system only
105logs information in these files if they are present. This is a local
106configuration issue. If you want the files to be used, they can be
107created with a simple \fBtouch\fP(1) command (for example,
108\fItouch /var/log/wtmp\fP).
109.\"{{{ Files
110.SH FILES
111/var/log/wtmp
112.br
113/var/log/btmp
114.\"}}}
115.\"{{{ Author
116.SH AUTHOR
117Miquel van Smoorenburg, miquels@cistron.nl
118.\"}}}
119.\"{{{ See also
120.SH "SEE ALSO"
121.BR shutdown (8),
122.BR login (1),
123.BR init (8)
124.\"}}}