| 1 |
.TH LASTCOMM 1 "1995 October 31" |
| 2 |
.SH NAME |
| 3 |
lastcomm \- print out information about previously executed commands. |
| 4 |
.SH SYNOPSIS |
| 5 |
.hy 0 |
| 6 |
.na |
| 7 |
.TP |
| 8 |
.B lastcomm |
| 9 |
[ |
| 10 |
.I command-name ... |
| 11 |
] |
| 12 |
.br |
| 13 |
[ |
| 14 |
.I user-name ... |
| 15 |
] |
| 16 |
.br |
| 17 |
[ |
| 18 |
.I terminal-name ... |
| 19 |
] |
| 20 |
.br |
| 21 |
[ OPTION ... ] |
| 22 |
.ad b |
| 23 |
.hy 1 |
| 24 |
.SH DESCRIPTION |
| 25 |
.LP |
| 26 |
.B lastcomm |
| 27 |
prints out information about previously executed |
| 28 |
commands. If no arguments are specified, |
| 29 |
.B lastcomm |
| 30 |
will print info |
| 31 |
about all of the commands in |
| 32 |
.I acct |
| 33 |
(the record file). If called with one or more of |
| 34 |
.I command-name, |
| 35 |
.I user-name, |
| 36 |
or |
| 37 |
.I terminal-name, |
| 38 |
only records containing those items will be displayed. For |
| 39 |
example, to find out which users used command `a.out' |
| 40 |
and which users were logged into `tty0', type: |
| 41 |
.ce |
| 42 |
lastcomm a.out tty0 |
| 43 |
.ce 0 |
| 44 |
.LP |
| 45 |
This will print any entry for which `a.out' or `tty0' |
| 46 |
matches in any of the record's fields (command, name, or terminal). If |
| 47 |
you want to find only items that match *all* of the arguments on the command |
| 48 |
line, you must use the '\-strict-match' option. For example, to list |
| 49 |
all of the executions of command |
| 50 |
.IR a.out " by user " root " on terminal " tty0, |
| 51 |
type: |
| 52 |
.ce |
| 53 |
lastcomm \-\-strict-match \-\-command a.out \-\-user root \-\-tty tty0 |
| 54 |
.ce 0 |
| 55 |
.LP |
| 56 |
The order of the arguments is not important. |
| 57 |
.LP |
| 58 |
For each entry the following information is printed: |
| 59 |
+ command name of the process |
| 60 |
+ flags, as recorded by the system accounting routines: |
| 61 |
S -- command executed by super-user |
| 62 |
F -- command executed after a fork but without a following exec |
| 63 |
C -- command run in PDP-11 compatibility mode (VAX only) |
| 64 |
D -- command terminated with the generation of a core file |
| 65 |
X -- command was terminated with the signal SIGTERM |
| 66 |
+ the name of the user who ran the process |
| 67 |
+ time the process started |
| 68 |
.SH OPTIONS |
| 69 |
.PD 0 |
| 70 |
.TP |
| 71 |
.B \-\-strict\-match |
| 72 |
Print only entries that match *all* of the arguments on the command |
| 73 |
line. |
| 74 |
.TP |
| 75 |
.B \-\-print\-controls |
| 76 |
Print control characters. |
| 77 |
.TP |
| 78 |
.BI \-\-user " name" |
| 79 |
List records for user with |
| 80 |
.I name. |
| 81 |
This is useful if you're trying |
| 82 |
to match a username that happens to be the same as a command (e.g., |
| 83 |
.I ed |
| 84 |
). |
| 85 |
.TP |
| 86 |
.BI \-\-command " name" |
| 87 |
List records for command |
| 88 |
.I name. |
| 89 |
.TP |
| 90 |
.BI \-\-tty " name" |
| 91 |
List records for tty |
| 92 |
.I name. |
| 93 |
.TP |
| 94 |
.BI \-\-forwards |
| 95 |
Read file forwards instead of backwards. This avoids trying to seek on the file |
| 96 |
and can be used to read from a pipe. This must be specified prior to any |
| 97 |
.BI \-f |
| 98 |
arguments. |
| 99 |
.TP |
| 100 |
.BI \-f " filename, " \-\-file " filename" |
| 101 |
Read from the file |
| 102 |
.I filename |
| 103 |
instead of |
| 104 |
.I acct. |
| 105 |
A filename of "-" will result in reading from stdin. This must either be the |
| 106 |
first |
| 107 |
.BI \-f |
| 108 |
option, or |
| 109 |
.BI \-\-forwards |
| 110 |
must precede all |
| 111 |
.BI \-f |
| 112 |
options. |
| 113 |
.TP |
| 114 |
.BI \-\-ahz " hz" |
| 115 |
Use this flag to tell the program what |
| 116 |
.B AHZ |
| 117 |
should be (in hertz). This option is useful if you are trying to view |
| 118 |
an |
| 119 |
.I acct |
| 120 |
file created on another machine which has the same byte order and file |
| 121 |
format as your current machine, but has a different value for |
| 122 |
.B AHZ. |
| 123 |
.TP |
| 124 |
.B \-p, \-\-show\-paging |
| 125 |
Print paging statistics. |
| 126 |
.TP |
| 127 |
.B \-\-pid |
| 128 |
Show PID and PPID of the process if acct version 3 format is supported by kernel. |
| 129 |
.TP |
| 130 |
.B \-\-pid |
| 131 |
Add pid of the process and pid of the process parent to the output |
| 132 |
(pid is the last but one and parent pid the last column). |
| 133 |
These values are shown only when they are generated by acct function |
| 134 |
(depends on the version of kernel) |
| 135 |
.TP |
| 136 |
.B \-\-debug |
| 137 |
Print verbose internal information. |
| 138 |
.TP |
| 139 |
.B \-V, \-\-version |
| 140 |
Print the version number of |
| 141 |
.B lastcomm. |
| 142 |
.TP |
| 143 |
.B \-h, \-\-help |
| 144 |
Prints the usage string and default locations of system files to |
| 145 |
standard output and exits. |
| 146 |
|
| 147 |
.SH FILES |
| 148 |
.I acct |
| 149 |
.RS |
| 150 |
The system wide process accounting file. See |
| 151 |
.BR acct (5) |
| 152 |
(or |
| 153 |
.BR pacct (5)) |
| 154 |
for further details. |
| 155 |
.RE |
| 156 |
.I /var/log/account |
| 157 |
.RS |
| 158 |
This directory contains pacct files which contain the binary process |
| 159 |
accounting data as written by the kernel. |
| 160 |
.RE |
| 161 |
.LP |
| 162 |
|
| 163 |
.SH AUTHOR |
| 164 |
The GNU accounting utilities were written by Noel Cragg |
| 165 |
<[email protected]>. The man page was adapted from the accounting |
| 166 |
texinfo page by Susan Kleinmann <[email protected]>. |
| 167 |
.SH "SEE ALSO" |
| 168 |
.BR last (1), |
| 169 |
.BR acct (5) |
| 170 |
|