2 .\" Copyright (c) 2000, Sun Microsystems, Inc.
3 .\" All Rights Reserved.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH LASTCOMM 1 "May 13, 2017"
9 lastcomm \- display the last commands executed, in reverse order
13 \fBlastcomm\fR [\fB-f\fR \fIfile\fR] [\fB-x\fR] [\fIcommand-name\fR] ... [\fIuser-name\fR] ...
14 [\fIterminal-name\fR] ...
19 The \fBlastcomm\fR command gives information on previously executed commands.
20 \fBlastcomm\fR with no arguments displays information about all the commands
21 recorded during the current accounting file's lifetime. If called with
22 arguments, \fBlastcomm\fR only displays accounting entries with a matching
23 \fIcommand-name\fR, \fIuser-name\fR, or \fIterminal-name\fR. If extended
24 process accounting is active (see \fBacctadm\fR(1M)) and is recording the
25 appropriate data items, \fBlastcomm\fR attempts to take data from the current
26 extended process accounting file. If standard process accounting is active,
27 \fBlastcomm\fR takes data from the current standard accounting file (see
31 If \fIterminal-name\fR is `\fB- -\fR', there was no controlling \fBTTY\fR for
32 the process. The process was probably executed during boot time. If
33 \fIterminal-name\fR is `\fB??\fR', the controlling \fBTTY\fR could not be
34 decoded into a printable name.
37 For each process entry, \fBlastcomm\fR displays the following items of
43 The command name under which the process was called.
49 One or more flags indicating special information about the process. The flags
50 have the following meanings:
59 The process performed a \fBfork\fR but not an \fBexec\fR.
68 The process ran as a set-user-id program.
78 The name of the user who ran the process.
84 The terminal which the user was logged in on at the time (if applicable).
90 The amount of \fBCPU\fR time used by the process (in seconds).
96 The date and time the process exited.
100 The following options are supported:
104 \fB\fB-f\fR \fIfile\fR\fR
107 Uses \fIfile\fR as the source of accounting data. \fIfile\fR may be either an
108 extended process accounting file or a standard process accounting file.
117 Uses the currently active extended process accounting file. If extended
118 processing accounting is inactive, no output will be produced.
123 \fBExample 1 \fRListing executions of named commands
131 example% \fBlastcomm a.out root term/01\fR
138 produces a listing of all the executions of commands named \fBa.out\fR by user
139 \fBroot\fR while using the terminal \fBterm/01\fR.
142 \fBExample 2 \fRListing all user commands
150 example% \fBlastcomm root\fR
157 produces a listing of all the commands executed by user \fBroot\fR.
162 \fB\fB/var/adm/pacct\fR\fR
165 standard accounting file
171 \fB\fB/var/adm/exacct/proc\fR\fR
174 extended accounting file
179 \fBlast\fR(1), \fBacctadm\fR(1M), \fBacct\fR(2), \fBacct.h\fR(3HEAD),
180 \fBcore\fR(4), \fBattributes\fR(5)