Annotation of src/usr.bin/last/last.1, Revision 1.22
1.22 ! jmc 1: .\" $OpenBSD: last.1,v 1.21 2004/06/16 22:30:07 millert 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
38: .Nd indicate last logins of users and ttys
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
117: If the
118: .Dq CC
119: and
120: .Dq YY
121: letter pairs are not specified, the values default to the current
122: year.
123: If the
124: .Dq SS
125: letter pair is not specified, the value defaults to 0.
1.22 ! jmc 126: .It Fl f Ar file
! 127: .Nm
! 128: reads the file
! 129: .Ar file
! 130: instead of the default,
! 131: .Pa /var/log/wtmp .
! 132: .It Fl h Ar host
! 133: .Ar host
! 134: names may be names or internet numbers.
! 135: .It Fl n Ar number
! 136: Limits the report to
! 137: .Ar number
! 138: lines.
! 139: The format
! 140: .Fl Ns Ar number
! 141: is also supported,
! 142: but is deprecated.
! 143: .It Fl s
! 144: Display time values in seconds since the epoch, instead of formatted dates.
! 145: .It Fl T
! 146: Display better time information, including seconds.
! 147: .It Fl t Ar tty
! 148: Specify the
! 149: .Ar tty .
! 150: tty names may be given fully or abbreviated, for example,
! 151: .Ic last -t 03
! 152: is
! 153: equivalent to
! 154: .Ic last -t tty03 .
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
1.18 millert 187: login database
1.1 deraadt 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 .