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