Annotation of src/usr.bin/last/last.1, Revision 1.16
1.16 ! aaron 1: .\" $OpenBSD: last.1,v 1.15 2000/06/07 23:19:28 deraadt 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
1.10 aaron 39: .Os
1.1 deraadt 40: .Sh NAME
41: .Nm last
42: .Nd indicate last logins of users and ttys
43: .Sh SYNOPSIS
44: .Nm last
1.13 aaron 45: .Op Fl csT
1.1 deraadt 46: .Op Fl Ns Ar n
47: .Op Fl f Ar file
48: .Op Fl h Ar host
49: .Op Fl t Ar tty
1.5 deraadt 50: .Op Fl d Ar [[yy]yy[mm[dd[hh]]]]mm[.ss]
1.7 aaron 51: .Op Ar user ...
1.1 deraadt 52: .Sh DESCRIPTION
1.13 aaron 53: The
1.14 aaron 54: .Nm
1.13 aaron 55: utility will either (1) list the sessions of specified
1.1 deraadt 56: .Ar users ,
57: .Ar ttys ,
58: and
1.10 aaron 59: .Ar hosts ,
60: in reverse time order,
1.3 jdm 61: or (2) list the users logged in at a specified snapshot date & time
1.13 aaron 62: in reverse time order.
63: Each line of output contains
1.1 deraadt 64: the user name, the tty from which the session was conducted, any
65: hostname, the start and stop times for the session, and the duration
1.13 aaron 66: of the session.
67: If the session is still continuing or was cut short by
1.1 deraadt 68: a crash or shutdown,
1.14 aaron 69: .Nm
1.1 deraadt 70: will so indicate.
1.13 aaron 71: .Pp
72: The options are as follows:
1.16 ! aaron 73: .Bl -tag -width Ds
1.6 downsj 74: .It Fl c
75: Calculates the total time displayed and prints it after the output.
1.1 deraadt 76: .It Fl f Ar file
1.14 aaron 77: .Nm
1.1 deraadt 78: reads the file
79: .Ar file
80: instead of the default,
81: .Pa /var/log/wtmp .
82: .It Fl Ar n
83: Limits the report to
84: .Ar n
85: lines.
1.13 aaron 86: .It Fl s
1.11 alex 87: Display time values in seconds since the epoch, instead of formatted dates.
1.1 deraadt 88: .It Fl t Ar tty
89: Specify the
90: .Ar tty .
1.7 aaron 91: tty names may be given fully or abbreviated, for example,
1.13 aaron 92: .Ic last -t 03
1.1 deraadt 93: is
94: equivalent to
1.13 aaron 95: .Ic last -t tty03 .
1.1 deraadt 96: .It Fl h Ar host
1.7 aaron 97: .Ar host
1.1 deraadt 98: names may be names or internet numbers.
1.4 mickey 99: .It Fl T
100: Display better time information, including seconds.
1.3 jdm 101: .It Fl d Ar date
1.10 aaron 102: Specify the snapshot date & time.
1.3 jdm 103: All users logged in at the snapshot date & time will
104: be reported.
1.10 aaron 105: This may be used with the
1.7 aaron 106: .Fl f
1.3 jdm 107: option to derive the results from stored wtmp files.
108: When this argument is provided, all other options except for
1.7 aaron 109: .Fl f
1.10 aaron 110: and
1.7 aaron 111: .Fl n
1.3 jdm 112: are ignored.
113: The argument should be in the form
114: .Dq [[CC]YY][MMDD]hhmm[.SS]
115: where each pair of letters represents the following:
116: .Pp
117: .Bl -tag -width Ds -compact -offset indent
118: .It Ar CC
119: The first two digits of the year (the century).
120: .It Ar YY
121: The second two digits of the year.
122: If
123: .Dq YY
124: is specified, but
125: .Dq CC
126: is not, a value for
127: .Dq YY
128: between 69 and 99 results in a
1.15 deraadt 129: .Dq CC
1.3 jdm 130: value of 19.
131: Otherwise, a
1.15 deraadt 132: .Dq CC
1.3 jdm 133: value of 20 is used.
134: .It Ar MM
1.7 aaron 135: Month of the year, from 1 to 12.
1.3 jdm 136: .It Ar DD
1.7 aaron 137: Day of the month, from 1 to 31.
1.3 jdm 138: .It Ar hh
1.7 aaron 139: Hour of the day, from 0 to 23.
1.3 jdm 140: .It Ar mm
1.7 aaron 141: Minute of the hour, from 0 to 59.
1.3 jdm 142: .It Ar SS
1.7 aaron 143: Second of the minute, from 0 to 61.
1.3 jdm 144: .El
145: .Pp
146: If the
147: .Dq CC
148: and
149: .Dq YY
150: letter pairs are not specified, the values default to the current
151: year.
152: If the
153: .Dq SS
154: letter pair is not specified, the value defaults to 0.
1.1 deraadt 155: .El
156: .Pp
157: If
1.3 jdm 158: multiple arguments are given, and a snapshot time is not specified, the
159: information which applies to any of the
1.1 deraadt 160: arguments is printed, e.g.,
1.13 aaron 161: .Ic last root -t console
1.1 deraadt 162: would list all of
1.13 aaron 163: .Li root Ns 's
1.14 aaron 164: sessions as well as all sessions on the console terminal.
165: If no users, hostnames, or terminals are specified,
166: .Nm
1.1 deraadt 167: prints a record of
168: all logins and logouts.
169: .Pp
170: The pseudo-user
1.13 aaron 171: .Dq reboot
1.9 pjanzen 172: logs in at reboots of the system; thus
1.13 aaron 173: .Ic last reboot
1.1 deraadt 174: will give an indication of mean time between reboot.
175: .Pp
176: If
1.14 aaron 177: .Nm
1.1 deraadt 178: is interrupted, it indicates to what date the search has
1.13 aaron 179: progressed.
180: If interrupted with a quit signal
1.14 aaron 181: .Nm
1.1 deraadt 182: indicates how
183: far the search has progressed and then continues.
184: .Sh FILES
185: .Bl -tag -width /var/log/wtmp -compact
186: .It Pa /var/log/wtmp
187: login data base
188: .El
189: .Sh SEE ALSO
190: .Xr lastcomm 1 ,
191: .Xr utmp 5 ,
192: .Xr ac 8
193: .Sh HISTORY
1.12 aaron 194: The
1.14 aaron 195: .Nm
1.12 aaron 196: command appeared in
1.1 deraadt 197: .Bx 3.0 .