Commit | Line | Data |
---|---|---|
15637ed4 RG |
1 | .\" Copyright (c) 1980, 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" Redistribution and use in source and binary forms, with or without | |
5 | .\" modification, are permitted provided that the following conditions | |
6 | .\" are met: | |
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 | .\" 3. All advertising materials mentioning features or use of this software | |
13 | .\" must display the following acknowledgement: | |
14 | .\" This product includes software developed by the University of | |
15 | .\" California, Berkeley and its contributors. | |
16 | .\" 4. Neither the name of the University nor the names of its contributors | |
17 | .\" may be used to endorse or promote products derived from this software | |
18 | .\" without specific prior written permission. | |
19 | .\" | |
20 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
30 | .\" SUCH DAMAGE. | |
31 | .\" | |
32 | .\" @(#)lastcomm.1 6.8 (Berkeley) 7/27/91 | |
33 | .\" | |
34 | .Dd July 27, 1991 | |
35 | .Dt LASTCOMM 1 | |
36 | .Os BSD 3 | |
37 | .Sh NAME | |
38 | .Nm lastcomm | |
39 | .Nd show last commands executed in reverse order | |
40 | .Sh SYNOPSIS | |
41 | .Nm lastcomm | |
42 | .Op Fl f Ar file | |
43 | .Op Ar command ... | |
44 | .Op Ar user ... | |
45 | .Op Ar terminal ... | |
46 | .Sh DESCRIPTION | |
47 | .Nm Lastcomm | |
48 | gives information on previously executed commands. | |
49 | With no arguments, | |
50 | .Nm lastcomm | |
51 | prints information about all the commands recorded | |
52 | during the current accounting file's lifetime. | |
53 | .Pp | |
54 | Option: | |
55 | .Pp | |
56 | .Bl -tag -width Fl | |
57 | .It Fl f Ar file | |
58 | Read from | |
59 | .Ar file | |
60 | rather than the default | |
61 | accounting file. | |
62 | .El | |
63 | .Pp | |
64 | If called with arguments, only accounting entries with a | |
65 | matching | |
66 | .Ar command | |
67 | name, | |
68 | .Ar user | |
69 | name, | |
70 | or | |
71 | .Ar terminal | |
72 | name | |
73 | are printed. | |
74 | So, for example: | |
75 | .Pp | |
76 | .Dl lastcomm a.out root ttyd0 | |
77 | .Pp | |
78 | would produce a listing of all the | |
79 | executions of commands named | |
80 | .Pa a.out | |
81 | by user | |
82 | .Ar root | |
83 | on the terminal | |
84 | .Ar ttyd0 . | |
85 | .Pp | |
86 | For each process entry, the following are printed. | |
87 | .Pp | |
88 | .Bl -bullet -offset indent -compact | |
89 | .It | |
90 | The name of the user who ran the process. | |
91 | .It | |
92 | Flags, as accumulated by the accounting facilities in the system. | |
93 | .It | |
94 | The command name under which the process was called. | |
95 | .It | |
96 | The amount of cpu time used by the process (in seconds). | |
97 | .It | |
98 | The time the process exited. | |
99 | .El | |
100 | .Pp | |
101 | The flags are encoded as follows: ``S'' indicates the command was | |
102 | executed by the super-user, ``F'' indicates the command ran after | |
103 | a fork, but without a following | |
104 | .Xr exec , | |
105 | ``C'' indicates the command was run in PDP-11 compatibility mode | |
106 | (VAX only), | |
107 | ``D'' indicates the command terminated with the generation of a | |
108 | .Pa core | |
109 | file, and ``X'' indicates the command was terminated with a signal. | |
110 | .Sh FILES | |
111 | .Bl -tag -width /var/account/acct -compact | |
112 | .It Pa /var/account/acct | |
113 | Default accounting file. | |
114 | .El | |
115 | .Sh SEE ALSO | |
116 | .Xr last 1 , | |
117 | .Xr sigvec 2 , | |
118 | .Xr acct 5 , | |
119 | .Xr core 5 | |
120 | .Sh HISTORY | |
121 | The | |
122 | .Nm lastcomm | |
123 | command appeared in | |
124 | .Bx 3.0 . |