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

Annotation of src/usr.bin/lastcomm/lastcomm.1, Revision 1.26

1.26    ! deraadt     1: .\"    $OpenBSD: lastcomm.1,v 1.25 2023/02/21 14:31:07 deraadt Exp $
1.3       deraadt     2: .\"    $NetBSD: lastcomm.1,v 1.5 1995/10/22 01:43:41 ghudson Exp $
1.1       deraadt     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.14      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: .\"    @(#)lastcomm.1  8.1 (Berkeley) 6/6/93
                     32: .\"
1.26    ! deraadt    33: .Dd $Mdocdate: February 21 2023 $
1.1       deraadt    34: .Dt LASTCOMM 1
1.11      aaron      35: .Os
1.1       deraadt    36: .Sh NAME
                     37: .Nm lastcomm
                     38: .Nd show last commands executed in reverse order
                     39: .Sh SYNOPSIS
                     40: .Nm lastcomm
                     41: .Op Fl f Ar file
                     42: .Op Ar command ...
                     43: .Op Ar user ...
                     44: .Op Ar terminal ...
                     45: .Sh DESCRIPTION
1.8       aaron      46: .Nm lastcomm
1.1       deraadt    47: gives information on previously executed commands.
                     48: With no arguments,
                     49: .Nm lastcomm
                     50: prints information about all the commands recorded
                     51: during the current accounting file's lifetime.
                     52: .Pp
1.12      aaron      53: The options are as follows:
1.13      aaron      54: .Bl -tag -width Ds
1.1       deraadt    55: .It Fl f Ar file
                     56: Read from
                     57: .Ar file
                     58: rather than the default
                     59: accounting file.
                     60: .El
                     61: .Pp
                     62: If called with arguments, only accounting entries with a
                     63: matching
                     64: .Ar command
                     65: name,
                     66: .Ar user
                     67: name,
                     68: or
                     69: .Ar terminal
                     70: name
                     71: are printed.
                     72: So, for example:
                     73: .Pp
                     74: .Dl lastcomm a.out root ttyd0
                     75: .Pp
                     76: would produce a listing of all the
                     77: executions of commands named
                     78: .Pa a.out
                     79: by user
                     80: .Ar root
                     81: on the terminal
1.12      aaron      82: .Ar ttyd0 .
1.1       deraadt    83: .Pp
1.8       aaron      84: For each process entry, the following are printed:
1.1       deraadt    85: .Pp
                     86: .Bl -bullet -offset indent -compact
                     87: .It
1.8       aaron      88: Name of the user who ran the process.
1.1       deraadt    89: .It
1.12      aaron      90: Flags, as accumulated by the system's accounting facilities.
1.1       deraadt    91: .It
1.8       aaron      92: Command name under which the process was called.
1.1       deraadt    93: .It
1.12      aaron      94: Amount of CPU time used by the process (in seconds).
1.1       deraadt    95: .It
1.8       aaron      96: Time the process started.
1.3       deraadt    97: .It
1.8       aaron      98: Elapsed time of the process.
1.1       deraadt    99: .El
                    100: .Pp
1.12      aaron     101: The flags are encoded as follows:
1.21      deraadt   102: .Pp
                    103: .Bl -tag -width 6n -compact -offset indent
                    104: .It Li D
                    105: The command terminated with the generation of a
                    106: .Pa core
                    107: file.
1.25      deraadt   108: .It Li E
                    109: The command terminated because it tried to
                    110: .Xr execve 2
                    111: in violation of
                    112: .Xr pinsyscall 2
                    113: policy.
1.21      deraadt   114: .It Li F
                    115: The command ran after
1.1       deraadt   116: a fork, but without a following
1.23      deraadt   117: .Xr execve 2 .
1.24      bluhm     118: .It Li M
                    119: The command did a system call from writable memory or the stack
                    120: pointer was not in stack memory.
1.21      deraadt   121: .It Li P
                    122: The command was terminated due to a
1.17      bluhm     123: .Xr pledge 2
1.21      deraadt   124: violation.
1.26    ! deraadt   125: .It Li S
        !           126: The command tried to execute a system call from the wrong
        !           127: system call instruction, see
        !           128: .Xr pinsyscalls 2 .
1.21      deraadt   129: .It Li T
                    130: The command did a memory access violation detected by a
                    131: processor trap.
                    132: .It Li U
                    133: The command tried a file access that was prevented by
1.20      bluhm     134: .Xr unveil 2 .
1.21      deraadt   135: .It Li X
                    136: The command was terminated with a signal.
                    137: .El
1.1       deraadt   138: .Sh FILES
                    139: .Bl -tag -width /var/account/acct -compact
                    140: .It Pa /var/account/acct
1.8       aaron     141: default accounting file
1.1       deraadt   142: .El
                    143: .Sh SEE ALSO
                    144: .Xr last 1 ,
1.22      millert   145: .Xr sigaction 2 ,
1.1       deraadt   146: .Xr acct 5 ,
1.10      alex      147: .Xr core 5 ,
                    148: .Xr accton 8
1.1       deraadt   149: .Sh HISTORY
                    150: The
                    151: .Nm lastcomm
                    152: command appeared in
                    153: .Bx 3.0 .