[BACK]Return to last.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / last

Annotation of src/usr.bin/last/last.1, Revision 1.21

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