Annotation of src/usr.bin/last/last.1, Revision 1.4
1.4 ! mickey 1: .\" $OpenBSD: last.1,v 1.3 1997/07/20 07:54:08 jdm Exp $
1.1 deraadt 2: .\" $NetBSD: last.1,v 1.3 1994/12/21 22:41:23 jtc Exp $
3: .\"
4: .\" Copyright (c) 1980, 1990, 1993
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" Redistribution and use in source and binary forms, with or without
8: .\" modification, are permitted provided that the following conditions
9: .\" are met:
10: .\" 1. Redistributions of source code must retain the above copyright
11: .\" notice, this list of conditions and the following disclaimer.
12: .\" 2. Redistributions in binary form must reproduce the above copyright
13: .\" notice, this list of conditions and the following disclaimer in the
14: .\" documentation and/or other materials provided with the distribution.
15: .\" 3. All advertising materials mentioning features or use of this software
16: .\" must display the following acknowledgement:
17: .\" This product includes software developed by the University of
18: .\" California, Berkeley and its contributors.
19: .\" 4. Neither the name of the University nor the names of its contributors
20: .\" may be used to endorse or promote products derived from this software
21: .\" without specific prior written permission.
22: .\"
23: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33: .\" SUCH DAMAGE.
34: .\"
35: .\" @(#)last.1 8.1 (Berkeley) 6/6/93
36: .\"
37: .Dd June 6, 1993
38: .Dt LAST 1
39: .Os BSD 4
40: .Sh NAME
41: .Nm last
42: .Nd indicate last logins of users and ttys
43: .Sh SYNOPSIS
44: .Nm last
45: .Op Fl Ns Ar n
1.4 ! mickey 46: .Op Fl Ns Ar T
1.1 deraadt 47: .Op Fl f Ar file
48: .Op Fl h Ar host
49: .Op Fl t Ar tty
1.3 jdm 50: .Op Fl d Ar [[CC]YY][MMDD]hhmm[.SS]
1.1 deraadt 51: .Op user ...
52: .Sh DESCRIPTION
53: .Nm Last
1.3 jdm 54: will either (1) list the sessions of specified
1.1 deraadt 55: .Ar users ,
56: .Ar ttys ,
57: and
1.3 jdm 58: .Ar hosts ,
59: in reverse time order,
60: or (2) list the users logged in at a specified snapshot date & time
1.1 deraadt 61: in reverse time order. Each line of output contains
62: the user name, the tty from which the session was conducted, any
63: hostname, the start and stop times for the session, and the duration
64: of the session. If the session is still continuing or was cut short by
65: a crash or shutdown,
66: .Nm last
67: will so indicate.
68: .Pp
69: .Bl -tag -width indent-two
70: .It Fl f Ar file
71: .Nm Last
72: reads the file
73: .Ar file
74: instead of the default,
75: .Pa /var/log/wtmp .
76: .It Fl Ar n
77: Limits the report to
78: .Ar n
79: lines.
80: .It Fl t Ar tty
81: Specify the
82: .Ar tty .
83: Tty names may be given fully or abbreviated, for example,
84: .Dq Li "last -t 03"
85: is
86: equivalent to
87: .Dq Li "last -t tty03" .
88: .It Fl h Ar host
89: .Ar Host
90: names may be names or internet numbers.
1.4 ! mickey 91: .It Fl T
! 92: Display better time information, including seconds.
1.3 jdm 93: .It Fl d Ar date
94: Specify the snapshot date & time.
95: All users logged in at the snapshot date & time will
96: be reported.
97: This may be used with the
98: .Ar -f file
99: option to derive the results from stored wtmp files.
100: When this argument is provided, all other options except for
101: .Ar -f file
102: and
103: .Ar -n
104: are ignored.
105: The argument should be in the form
106: .Dq [[CC]YY][MMDD]hhmm[.SS]
107: where each pair of letters represents the following:
108: .Pp
109: .Bl -tag -width Ds -compact -offset indent
110: .It Ar CC
111: The first two digits of the year (the century).
112: .It Ar YY
113: The second two digits of the year.
114: If
115: .Dq YY
116: is specified, but
117: .Dq CC
118: is not, a value for
119: .Dq YY
120: between 69 and 99 results in a
121: .Dq YY
122: value of 19.
123: Otherwise, a
124: .Dq YY
125: value of 20 is used.
126: .It Ar MM
127: The month of the year, from 1 to 12.
128: .It Ar DD
129: the day of the month, from 1 to 31.
130: .It Ar hh
131: The hour of the day, from 0 to 23.
132: .It Ar mm
133: The minute of the hour, from 0 to 59.
134: .It Ar SS
135: The second of the minute, from 0 to 61.
136: .El
137: .Pp
138: If the
139: .Dq CC
140: and
141: .Dq YY
142: letter pairs are not specified, the values default to the current
143: year.
144: If the
145: .Dq SS
146: letter pair is not specified, the value defaults to 0.
1.1 deraadt 147: .El
148: .Pp
149: If
1.3 jdm 150: multiple arguments are given, and a snapshot time is not specified, the
151: information which applies to any of the
1.1 deraadt 152: arguments is printed, e.g.,
153: .Dq Li "last root -t console"
154: would list all of
155: .Dq Li root Ns 's
156: sessions as well as all sessions on the console terminal. If no
157: users, hostnames or terminals are specified,
158: .Nm last
159: prints a record of
160: all logins and logouts.
161: .Pp
162: The pseudo-user
163: .Ar reboot
164: logs in at reboots of the system, thus
165: .Dq Li last reboot
166: will give an indication of mean time between reboot.
167: .Pp
168: If
169: .Nm last
170: is interrupted, it indicates to what date the search has
171: progressed. If interrupted with a quit signal
172: .Nm last
173: indicates how
174: far the search has progressed and then continues.
175: .Sh FILES
176: .Bl -tag -width /var/log/wtmp -compact
177: .It Pa /var/log/wtmp
178: login data base
179: .El
180: .Sh SEE ALSO
181: .Xr lastcomm 1 ,
182: .Xr utmp 5 ,
183: .Xr ac 8
184: .Sh HISTORY
185: .Nm Last
186: appeared in
187: .Bx 3.0 .