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