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