1 .\" Copyright (c) 1980, 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" From: @(#)lastcomm.1 8.1 (Berkeley) 6/6/93
36 .Nd show last commands executed
48 utility gives information on previously executed commands.
51 prints information about all the commands recorded
52 during the current accounting file's lifetime.
54 The following options are available:
55 .Bl -tag -width indent
57 Print the time the process exited.
59 Print the time the process started.
61 Print the amount of cpu time used by the process.
63 Print the amount of elapsed time used by the process.
65 Print the amount of system time used by the process.
67 Print the amount of user time used by the process.
71 rather than the default
72 .Pa /var/account/acct .
78 reads accounting entries from the standard input.
81 An operand with a leading plus sign
83 is followed a user-defined format string which specifies the format
84 in which to display the process's start or exit date and time.
85 The format string may contain any of the conversion specifications
88 manual page, as well as arbitrary text.
90 If no options are specified,
95 is invoked with arguments, only accounting entries with a
107 .Dl lastcomm a.out root ttyd0
109 would produce a listing of all the
110 executions of commands named
117 For each process entry, the following are printed.
119 .Bl -bullet -offset indent -compact
121 The name of the user who ran the process.
123 Flags, as accumulated by the accounting facilities in the system.
125 The command name under which the process was called.
136 time used by the process (in seconds).
138 The time the process started
144 The flags are encoded as follows: ``S'' indicates the command was
145 executed by the super-user, ``F'' indicates the command ran after
146 a fork, but without a following
148 .\" ``C'' indicates the command was run in PDP-11 compatibility mode
150 ``D'' indicates the command terminated with the generation of a
152 file, and ``X'' indicates the command was terminated with a signal.
154 By default, accounting entries are printed going backwards in time,
155 starting from the time
160 reads entries from its standard input, then entries are printed in
161 the order they are read.
163 .Bl -tag -width /var/account/acct -compact
164 .It Pa /var/account/acct
165 default accounting file
170 will print the exit time and elapsed time of each command logged in
171 .Pa /var/account/acct ,
173 .Dl tail -f -c 0 /var/account/acct | lastcomm -f -
174 will print details of each terminating command.